rebase(Git)
rebase
$ git rebase target_branch
移動單一branch指向別的commit
用於保持整體分支線乾淨
會提交一次新的commit
即把當前branch的HEAD改為指定branch的最後一個commit
在無參數的情況下
可以藉此達成fast-forward merge
但會必須要強制push
$ git push --force-with-lease --force-if-includes
--force-with-lease會先確認commit的hash是否相同
如果不同則代表是其他人的commit,就會中止push
或是整理/修正過去的commit
重新排序、整合、更改訊息…
$ git rebase -i HEAD~4
使用互動式編輯視窗模式
gitでstashが面倒なあなたにautostash
$ git config --global rebase.autostash true
git merge 與 rebase 的觀念與實務應用
rebase をちゃんと理解して使えるようになろう!
Git Rebase: Don't be Afraid of the Force (Push) - Gerald Versluis
rebase 教から脱退します #Git - Qiita