#til

#TIL : Resolving conflict like a boss

When using git merge new branch to old branch, you just want use all ours or theirs version but be lazy to update every conflicted file.

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

Or

grep -lr '<<<<<<<' . | xargs git checkout --theirs

Explain : these commands will find any file contains <<<<<<< string (conflicted file) and run git checkout --[side]

Enjoyed this post?

If you found this helpful, consider sharing it or leaving a kudo!

0 kudos