Skip to content

Instantly share code, notes, and snippets.

@kenny-evitt
Last active September 12, 2016 20:03
Show Gist options
  • Save kenny-evitt/e93a7e5d33babbbbe36161f76c219c8f to your computer and use it in GitHub Desktop.
Save kenny-evitt/e93a7e5d33babbbbe36161f76c219c8f to your computer and use it in GitHub Desktop.
Git alias to save 'ours' and 'theirs' versions of a merge-conflicted file
# Because Git has really good Bash completion support, naming the alias `save-ours-theirs` is just as easy to type but a *lot* more readable.
# Add to Git config file, e.g. *~/.gitconfig*
# Example: `git sot Static\ Data/dbo.TABLE.sql`
[alias]
sot = "!f(){ git show :2:\"$1\" > ours && git show :3:\"$1\" > theirs; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment