Gadi A
Gadi A

Reputation: 3539

Git branching: easily merging a third branch into two conflicting branches

I have the following situation in git: One "stable" branch and one "unstable" branch. The unstable branch contains bugs which I try to find by running both the stable and unstable branches on the same input and comparing their output logs.

Now, my logging framework is not good enough for this debug. So I want to improve my logging class. I create a new branch, "log_improve" from "stable". After I'll finish working on it, I'll merge it back to "stable". Up to here all is great.

My question is: How can I merge "log_improve" with the "unstable" branch while completely avoiding all the "stable/unstable" conflicts? I'm only interested in the changes "log_improve" did to the logger class, which is separate from the code "stable" and "unstable" disagree upon.

Upvotes: 1

Views: 147

Answers (1)

Amadan
Amadan

Reputation: 198388

I'd say, get rid of the conflicts. The merge that creates the conflicts (unstable -> stable) is not committed yet (can't be, as long as you have conflicts); so just reset your working directory, and merge log_improve into first one, then the other of the working branches. Then try the unstable -> stable merge again.

Upvotes: 2

Related Questions