Denis B
Denis B

Reputation: 21

Git: rebase merge commit

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.

Upvotes: 2

Views: 4486

Answers (1)

mdup
mdup

Reputation: 8559

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

Upvotes: 6

Related Questions