Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Git, is there a way to automatically mark all newer vesions of files in a merge conflict as correct?

So I've come across a merge conflict with my repo, the older versions are all ~1 month old, is there any simple command to mark all the newer versions as correct rather than having to do it for every individual file (I'm working with ~1000 files)

Thanks

like image 855
wyqydsyq Avatar asked Feb 24 '23 07:02

wyqydsyq


1 Answers

As described in the Git merge command, the recursive strategy accepts the ours and theirs options, among others. Both options resolve conflicts by overwriting the existing or incoming versions, respectively.

I don't know which version is the newer in your case, so I cannot tell you exactly which of the two options you should specify, but I guess you'll figure it out.

Note: As pointed out by @Mark Longair, the ours strategy also exists, but has a different effect than the ours option to the recursive strategy. Be careful not to confuse them.

like image 192
Laurent Pireyn Avatar answered Feb 27 '23 09:02

Laurent Pireyn