omer mazig
omer mazig

Reputation: 1063

How do I merge multiple branches without commiting?

Is it possible? I'm able to merge one branch using --no-commit, but when try to merge another one it said that I haven't concluded my current merge.

How can I conclude it without commiting it?

Upvotes: 1

Views: 454

Answers (1)

aneroid
aneroid

Reputation: 16072

If your merges definitely won't require any manual intervention (no conflicts), then you should use the Octopus merge strategy. You would use it like this, assuming you are on master and want to merge other branches is:

git merge some_branch other_branch third_branch

This other SO question has a good explanation.

You cannot continue merging in other branches in different steps without committing first.

You could also try using the --squash option to prevent creating the commit/postpone it to the next merge but it will make the git history look a bit strange.

Upvotes: 3

Related Questions