0
我有5個提交推送給gerrit進行審查。說1,2,3,4,5Gerrit在同一分支上提交更改absoluteed commit
審閱拋棄我的第二個承諾,並接受1,3,4,5
現在,3,4和5不能由於放棄了改變推。
有人請讓我知道如何推3,4,5變成分支。
所有5個提交都在同一分支上。
我有5個提交推送給gerrit進行審查。說1,2,3,4,5Gerrit在同一分支上提交更改absoluteed commit
審閱拋棄我的第二個承諾,並接受1,3,4,5
現在,3,4和5不能由於放棄了改變推。
有人請讓我知道如何推3,4,5變成分支。
所有5個提交都在同一分支上。
在本地資源庫,與凱明-5 checkouted,執行以下命令:
git rebase -i COMMIT-1
編輯器會像這樣的東西打開:
pick COMMIT-2 COMMIT-2-MSG
pick COMMIT-3 COMMIT-3-MSG
pick COMMIT-4 COMMIT-4-MSG
pick COMMIT-5 COMMIT-5-MSG
# Rebase xxxxx..xxxxx onto xxxxx
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit
更改 「選擇」 到「拖放「在COMMIT-2行中,保存,關閉編輯器,並將commit-2從歷史記錄中刪除(運行」git log「確認)。推到Gerrit。
注意:爲避免出現這種情況,請不要向Gerrit發送多行提交。始終平行地處理您的提交(更多信息here)。