Moving commit diverges branches #23999
-
I have a repo with a master branch of 4 commits: 1-2-3-4 (HEAD → master) Then I created a new branch (b2) and made the fifth commit, I merged b2 to master. 1-2-3-4-5(HEAD → master, b2) Now I wanna change the order of commit 2 so I made 1-3-4-2-5 (HEAD → master) Two diverge branches. And the result I want is : 1-3-4-2-5 (HEAD → master, b2) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There are various ways to achieve this:
|
Beta Was this translation helpful? Give feedback.
-
Thank you, this worked. |
Beta Was this translation helpful? Give feedback.
There are various ways to achieve this:
git push origin master:b2 --force-with-lease
git checkout b2; git reset --hard master; git push origin b2 --force-with-lease