2

How i should use rebase for this case:

I have 3 features in branches:

feature/f1
feature/f2
feature/f3

and I have master branch: master I merge this 3 features into master branch.

My commit history looks like:

Merge f3 into master
Merge f2 into master
Merge f1 into master

During testing, I found that my function f2 is not working correctly.

How could I rebase changes (not interactive mode), to my history looks like:

Merge f3 into master
Merge f1 into master

Thanks.

Denis B
  • 21
  • 1
  • 3
  • possible duplicate of [Rebase a merge commit](http://stackoverflow.com/questions/9013411/rebase-a-merge-commit) – sschuberth Oct 29 '14 at 12:55

1 Answers1

6

You could use git rebase --preserve-merges -i HEAD~4. This will open an editor with the three last commits. Remove the line where "Merge f2 into master" appears.

More information on rebase -i

mdup
  • 7,889
  • 3
  • 32
  • 34