Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git merge conflict with 500 files added on local and origin

I'm using Git in Visual Studio and suddenly got this conflict on all files screenshot

I can click through each and every conflict and choose Take Source, but since there are 534 conflicts, I would rather do a batch resolve on the command line. What would be the appropriate commands to resolve all these conflicts?

like image 620
Eivind Gussiås Løkseth Avatar asked Jun 06 '14 22:06

Eivind Gussiås Løkseth


1 Answers

Check the differences between the conflicts reported by Visual Studio.

It is possible that they are about eol style onle (end-of-line LF vs. CRLF)

You can try setting git config core.autocrlf true/false to see what would work best, but this Q/A page does mention that the Git plugin doesn't seem to respect that setting anyway.


The OP Eivind Gussiås Løkseth adds in the comments:

I'm looking for a command to do that for all conflicts in one operation, because doing it for all 500 conflicts would take a lot of time

As mentioned in "Simple tool to 'accept theirs' or 'accept mine' on a whole file using git", you could, in the root folder of your repo, do a:

git checkout HEAD -- .
like image 155
VonC Avatar answered Oct 30 '22 04:10

VonC