我有以下git结构(Numbers表示提交):
_ 1 _ 2 _ 3 _ 4 (Branch mainline)
_|
|_ 1 _ 2 _ 3 _ 4 _ 5 (Branch Test)
因此,Test有一个额外的提交而不是主线。我基本上需要将该提交复制到主线。我该怎么做?
所以我的最终状态应该是:
_ 1 _ 2 _ 3 _ 4 _ 5 (Branch mainline)
_|
|_ 1 _ 2 _ 3 _ 4 _ 5 (Branch Test)
答案 0 :(得分:0)
一个选项:
git checkout mainline
然后是任何一个:
git merge test
git rebase test
git reset --hard test
git cherry-pick test #probably not really recommended
另一种选择:
git branch -D mainline
git checkout -b mainline test
我相信还有更多。