2014-08-29 53 views
1

我想將幾個提交合併爲一個提交。如何在推送前清理git提交日誌?

git checkout origin/develop -b develop 
echo "a" >> README && git commit -am "Feature A commit 1" 
echo "a" >> README && git commit -am "Feature B commit 1" 
echo "a" >> README && git commit -am "Feature A commit 2" 
echo "a" >> README && git commit -am "Feature B commit 2" 
echo "a" >> README && git commit -am "Feature A commit 3" 
echo "a" >> README && git commit -am "Feature B commit 3" 

我推之前,我想成爲一個承諾Feature A commit結合Feature A commit 1,2,3,並同Feature B

我該怎麼做?

回答

0

的命令做出如下:

git rebase -i <ref> 

此命令將打開您的編輯器,並告訴你每一個可能的選項重新排序/壁球/重命名......你的提交。

希望這會幫助你。

這是關於git rebase的文檔:git-rebase