Accessing different branches during git merge conflict
I know that you can see the state of the file during a merge conflict using
git show :1:file
git show :2:file
git show :3:file
But what do I want to do diff? git diff :1 :2
does not recognize these branches. Is there a git command to do this (of course I can save :1:file
locally and do the diff manually.
Also, I can't seem to find a link to this show :1:file
in the doc?
+3
source to share
1 answer
Perhaps you can use the unix command diff
and a couple of temporary named pipes with the syntax <(...)
(as described in this article ):
diff <(git show :1:file) <(git show :2:file)
vimdiff <(git show :1:file) <(git show :2:file)
+1
source to share