Git: get ours/theirs file content during merge
Hidden in the docs :
git show :1:file/path # base
git show :2:file/path # ours
git show :3:file/path # theirs
When a merge conflict is triggered because of a merge
action, HEAD
still points to the original commit, and MERGE_HEAD
to the commit trying to be merged in, so :
git show HEAD:file/path # ours
git show MERGE_HEAD:file/path # theirs
will also work, and perhaps be more explicit to the user.