Right now the main branch has the commit order 1,3,4. with 2 being a separate commit from 1. I need the order to be 1, 2, 3, 4. How do I do it? I'm unable to figure out how to use rebase over here. Thanks for the help
- 1This is tough to handle, because it appears that one of the commit is actually a merge commit. Even if you try an interactive rebase, you might have to re-resolve all the merge conflicts.Tim Biegeleisen– Tim Biegeleisen2019-09-17 13:26:49 +00:00Commented Sep 17, 2019 at 13:26
- 1Easy, not necessarily minimal, way is to merge master, then rebase.Ry-– Ry- ♦2019-09-17 13:26:51 +00:00Commented Sep 17, 2019 at 13:26
Add a comment |
1 Answer
You need a simple git rebase:
git checkout sumant # your current branch git rebase origin/master NOTES:
- you can replace
origin/masterwithc0fbd68... it all points to the same commit :) - your commit 2 can contain changes that conflict with your commits 3,4,... You'll have to solve these conflicts manually.
gitdoes what it can, but cannot resolve all conflicts automatically.
1 Comment
Sumant Agnihotri
Worked like a charm. Thanks a lot.
