So I have two branches, lets say Branch A and Branch B I have merged branch A into branch B.
git checkout B
git merge A
Now I want to resolve differences in favor of branch A in command line. How do I do it?
So I have two branches, lets say Branch A and Branch B I have merged branch A into branch B.
git checkout B
git merge A
Now I want to resolve differences in favor of branch A in command line. How do I do it?
You're looking for the the -s recursive -Xtheirs
option for git merge
.
This option does the opposite of the following:
...This option forces conflicting hunks to be auto-resolved cleanly by favoring 'our' version. Changes from the other tree that do not conflict with our side are reflected to the merge result. For a binary file, the entire contents are taken from our side...
Since you've already started the merge, you're going to want abort it since you cannot apply this merge strategy during a current merge.
git merge --abort
then re-do the merge as follows
git merge -s recursive -Xtheirs
That will do the merge so that all of the 'conflicts' are auto-picked to be from branch A