Skip to content

Instantly share code, notes, and snippets.

@hyponymous
Created June 3, 2016 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyponymous/3600f06f5cb60ba824ef9f06021c7638 to your computer and use it in GitHub Desktop.
Save hyponymous/3600f06f5cb60ba824ef9f06021c7638 to your computer and use it in GitHub Desktop.
One-liner that creates two diffs of a conflicted file (whose name is in the paste buffer) and opens them side by side in vim – for resolving merge conflicts
file=$(pbpaste); git diff -b -M :1:$file :2:$file >~/tmp/left.diff; git diff -b -M :1:$file :3:$file >~/tmp/right.diff; vim -O ~/tmp/left.diff ~/tmp/right.diff # ;three-way
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment