til

#TIL : Resolving conflict like a boss

I learned on 2017-06-13 about dev, git, sysadmin

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?

Leave a kudo — it means a lot.

0