0

enter image description here

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

2
  • 1
    This 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. Commented Sep 17, 2019 at 13:26
  • 1
    Easy, not necessarily minimal, way is to merge master, then rebase. Commented Sep 17, 2019 at 13:26

1 Answer 1

3

You need a simple git rebase:

git checkout sumant # your current branch git rebase origin/master 

NOTES:

  • you can replace origin/master with c0fbd68... 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. git does what it can, but cannot resolve all conflicts automatically.
Sign up to request clarification or add additional context in comments.

1 Comment

Worked like a charm. Thanks a lot.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.