Skip to content

Instantly share code, notes, and snippets.

@wikiti
Last active October 9, 2018 10:05
Show Gist options
  • Save wikiti/9ebb0755dce5d63444019b99b4575e23 to your computer and use it in GitHub Desktop.
Save wikiti/9ebb0755dce5d63444019b99b4575e23 to your computer and use it in GitHub Desktop.
Resolve a binary conflict when performing merges. Of course, this works too for plain text files.
# Use this commands after a git merge conflict, if you can't
# (or don't want to) fix the conflicts on some files.
# To use the base branch's file, use this:
git checkout --ours -- path/to/your/file.ext
git add path/to/file.ext
# To use the compare branch's file, use this:
git checkout --theirs -- path/to/your/file.ext
git add path/to/file.ext
# For example:
git checkout --theirs -- spec/fixtures/example.docx
git add spec/fixtures/example.docx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment