Skip to content

Instantly share code, notes, and snippets.

@debidatta
Last active July 4, 2019 14:35
Show Gist options
  • Save debidatta/35f9e0dcf3b8db2bc4ca to your computer and use it in GitHub Desktop.
Save debidatta/35f9e0dcf3b8db2bc4ca to your computer and use it in GitHub Desktop.
Merging two branches with priority in conflict resolution
# If you want to keep changes of the current branch
grep -lr '<<<<<<<' . | xargs git checkout --ours
# If you want to keep the changes of the branch that is being merged
grep -lr '<<<<<<<' . | xargs git checkout --theirs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment