我有以下的分支,其中的A
是當前活躍的分支:的底墊git的快捷方式,併合並
*A C
|/
B
通常情況下,我想變基C
到A
然後合併成C
A
。到目前爲止,我正在使用單個命令:
git checkout C
git rebase A
git checkout A
git merge C
# and optional to clean up no longer needed branches
git branch -d C
git push origin :C
在一個命令中執行此操作的簡單方法是什麼?有沒有「git-way」或者我必須依賴shell腳本?
我想你必須使用shell腳本只是有點像這樣http://stackoverflow.com/questions/18860696/syntax-for-git-aliases-with-multiple-commands或這個http:///stackoverflow.com/questions/7534184/git-alias-multiple-commands-and-parameters,但如果rebase導致任何衝突發生,那麼你可能在合併時遇到問題。 – Deep