I have the following:
branch0 --- commit1 --- commit2 --- branch2 --- commit3
|
branch1
|
commit4
|
commit5
I would like to change it to the following (i.e. move everything from commit1
):
branch0
|
branch1
|
commit4
|
commit5 --- commit1 --- commit2 --- branch2 --- commit3
I have tried using rebase
and cherry-pick
, but I am not knowledgeable enough, so any suggestions welcome please.
Thanks
UPDATE
From mimikrija's answer below, I try the following:
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
I get the following error:
fatal: Invalid branch name: 'HEAD'
git status
rebase in progress; onto 89844e6
You are currently rebasing branch 'temp' on '89844e6'.
(all conflicts fixed: run "git rebase --continue")