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).
我设法成功地做到这一点,所发生的冲突是应该发生的,是容易解决。
我对结果非常满意,但无论如何我想知道是否有更好的方法来做到这一点。