3
假設我有我的回購以下病史:擠壓第一和第三的提交(離開第二unsquashed)
git log --oneline
<3rd sha1> Third commit.
<2nd sha1> Second commit.
<1st sha1> First commit.
如何壁球第三個承諾第一個離開第二不變?
假設我有我的回購以下病史:擠壓第一和第三的提交(離開第二unsquashed)
git log --oneline
<3rd sha1> Third commit.
<2nd sha1> Second commit.
<1st sha1> First commit.
如何壁球第三個承諾第一個離開第二不變?
我已經這樣做了:
git rebase -i HEAD~3
。編輯於:
挑<第二SHA1 >第二次提交。
挑< 1st sha1 >第一次提交。
壁球< 3 sha1 >第三次提交。
解決了coflict:error: could not apply <2nd sha1>... Second commit.
。
git rebase --continue
。error: could not apply <1nd sha1>... First commit.
。git rebase --continue
。First commit (squashed).
)。然後完成了。
git log --oneline
:
git log --oneline
<2nd sha1> Second commit.
<1st sha1> First commit (squashed).
我設法成功地做到這一點,所發生的衝突是應該發生的,是容易解決。
我對結果非常滿意,但無論如何我想知道是否有更好的方法來做到這一點。