Git - Resolving Merge Conflicts For Auto-Generated Files

If you have a situation where your git repo includes auto-generated files, those can quickly become a source of merge conflicts. In order to resolve those quickly you can automatically accept the current branches version of the files by running

grep -lr "<<<<<<<" . | xargs git checkout --ours  

This command will find any files that have the merge conflict marker and tells git to use "our" version of the file to resolve any conflicts.

Wes Shaddix

Read more posts by this author.