Richard
Richard

Reputation: 61519

Git "manual merge" strategy

I have two branches in which the project is working at both tips.

I merge Branch A into Branch B (git checkout BranchB; git merge BranchA), resolve conflicts, and test Branch B to find that it no longer works.

I'm pretty sure the problem is being caused by just one or two commits from Branch A that git is prioritizing above Branch B. Therefore, I'm looking for a way to merge in which "auto-merges" don't take place, so that I can bring to bear a fine degree of control over how conflict resolution takes place. Is this possible?

Upvotes: 4

Views: 2196

Answers (3)

torek
torek

Reputation: 490068

This seems like it calls for git-imerge. Which I admit I have never used, but it would give you the ability to do tests on "intermediate" merges, or on the individual commits in a "rebase-with-history" style merge.

Upvotes: 0

Eugene Sajine
Eugene Sajine

Reputation: 8200

I think that the best solution would be to rebase Branch A on branch B instead of merging. I this case each commit that you have conflicts on would require your manual intervention and you can effectively resolve it the way it supposed to be.

After the rebase of branch A on branch B the merge of branch A to branch B will result in a simple fast-forward

so:

git checkout branchA
git rebase branchB

resolve conflict on a commit

git add file_with_conflicts
git rebase --continue

Upvotes: 0

mwarsco
mwarsco

Reputation: 541

I'm not sure about skipping merging all together, but you can use

git merge --no-commit

This will allow you to perform the merge, then inspect the merged files before they're committed.

Upvotes: 2

Related Questions