Quickest way to resolve Git Merge Conflicts

The solution which is provided below is one of the most easiest way to resolve git merge conflicts
If you wanted to accept ours changes and remove theirs, run:
git checkout --ours PATH/FILE
If you wanted to accept theirs changes and remove ours, run:
git checkout --theirs PATH/FILE
If you have multiple files, you can use the following commands.
grep -lr '<<<<<<<' . | xargs git checkout --ours
grep -lr '<<<<<<<' . | xargs git checkout --theirs

Comments

Popular posts from this blog

Inserting and Moving elements inside Ruby Array

Interview Question on Ruby on Rails