Julius A
Julius A

Reputation: 39622

How do I accept Git branch merge changes in multiple files in one go in Visual Studio Team Explorer?

I am doing a git branch merge between two branches using Visual Studio Team Explorer for a Git Repo. I have made a decision to 'Keep Target' changes. I have 190 code files to do. At present, it appears I have to go through each file and click 'Keep Taget'. Please see the screen shot below:

Team Explore screen shot

Any ideas how I can do this in a batch? Any script that I can run to do all these files?

Upvotes: 9

Views: 2072

Answers (1)

Steve
Steve

Reputation: 1768

Undo the merge in Visual Studio Team Explorer and use the Git command line.

Assuming you're on the master-wg branch, do:

git merge -X ours develop-wg

The -X ours option forces merge conflicts to be auto-resolved by favouring 'our' version (i.e from the branch we're currently checked out on, the branch we're merging into). Changes from the other branch that do not conflict with our branch will also be reflected in the merge result.

Upvotes: 4

Related Questions