0

I have an issue where I am merging in a branch that has produced over 50 files of merge conflicts. The only merge conflicts I was concerned about are the ones that affected the files I recently changed. I went and manually resolved and staged those files. Now 44 files remain. I would just like to accept incoming for all of them. Is there a way I can do that, either through git or vscode? Every solution i found online is resolving all or none, and vscode can only accept incoming conflicts for 1 file, not multiple files.

Jeremy Fisher
  • 2,510
  • 7
  • 30
  • 59

1 Answers1

2

You could fetch the list of remaining conflicting files with

git diff --name-only --diff-filter=U

Found here.

Once you've got that you can just checkout each of them from the branch being merged in.

git diff --name-only --diff-filter=U | xargs git checkout --theirs --

Your working tree will now have only the changes from the branch you're merging in so you can just stage and commit everything.

Calum Halpin
  • 1,945
  • 1
  • 10
  • 20