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.

1

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

6 Comments

you need to add --preserve-merges to the rebase command, or the f3 merge won't be correctly rebased
Thanks for your answer. I need to rebase this merge commit in auto mode. Updated description.
Is there any not-interactive mode? I need autorebase merge commit from history
@DenisB: Why don't you want interactive mode?
I have wrote tool, that helps me to merge features into build branch.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.