Git and DiffTool problems : What do LOCAL and REMOTE point to?

there are 4 components to this (note that before this step, you would have already done a local-checkin.)

  • The local-checkin that your git tree has: LOCAL
  • The head of the remote repository (that is going to be merged): REMOTE
  • common ancestor to both LOCAL and REMOTE: BASE
  • The file that will be written as a result: MERGED.

I think that means that $LOCAL is always the a/whatever in the diff output, while $REMOTE is the b/whatever. In other words, if you do:

 git difftool master experiment -- Makefile

$LOCAL will be a temporary file showing the the state of Makefile in the master branch, while $REMOTE will be a temporary file showing its state in the experiment branch.

If you just run:

git difftool

... that shows you the difference between the index and your working tree, so for each file with differences, $LOCAL will be a temporary file that's the same as the version of the file in the index, while the $REMOTE will be the version of the file in your working tree.


I am using TortoiseSvn for merge and diff and is working as expected. While in diff, it shows my working copy on the right. My .gitconfig with TortoiseSvn is as follows

[diff]
    tool = tortoise


[merge]
    tool = tortoise


[mergetool "tortoise"]
    cmd = TortoiseMerge.exe -base:\"$BASE\" -mine:\"$LOCAL\" -theirs:\"$REMOTE\" -merged:\"$MERGED\"
[difftool "tortoise"]
    cmd = tortoisemerge.exe -mine:\"$REMOTE\" -base:\"$LOCAL\"