我有以下内容:
branch0 --- commit1 --- commit2 --- branch2 --- commit3
|
branch1
|
commit4
|
commit5
我想将其更改为以下内容(即将所有内容从
commit1
移动):branch0
|
branch1
|
commit4
|
commit5 --- commit1 --- commit2 --- branch2 --- commit3
我尝试使用 rebase
和 cherry-pick
,但是我的知识不够丰富,所以欢迎任何建议。
谢谢。
更新:
从 mimikrija 的下面的答案中,我尝试了以下方法:
git checkout branch0
git checkout -b temp
git rebase branch1
## fix conflicts
git add .
git commit -am "rebase applied"
git rebase --continue
git branch -mv -f branch1
我收到以下错误消息:
致命错误:无效的分支名称:“HEAD”
git status
rebase in progress; onto 89844e6
You are currently rebasing branch 'temp' on '89844e6'.
(all conflicts fixed: run "git rebase --continue")