Git Diff with Beyond Compare
I don't use extra wrapper .sh files. My environment is Windows XP, git 1.7.1 on cygwin, and Beyond Compare 3. Following is my .git/config file.
[diff]
tool = bc3
[difftool]
prompt = false
[difftool "bc3"]
#use cygpath to transform cygwin path $LOCAL (something like /tmp/U5VvP1_abc) to windows path, because bc3 is a windows software
cmd = \"c:/program files/beyond compare 3/bcomp.exe\" "$(cygpath -w $LOCAL)" "$REMOTE"
[merge]
tool = bc3
[mergetool]
prompt = false
[mergetool "bc3"]
#trustExitCode = true
cmd = \"c:/program files/beyond compare 3/bcomp.exe\" "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
Then, I use $ git difftool to compare and $ git mergetool to merge.
About trustExitCode: For a custom merge command, specify whether the exit code of the merge command can be used to determine whether the merge was successful. If this is not set to true then the merge target file timestamp is checked and the merge assumed to have been successful if the file has been updated, otherwise the user is prompted to indicate the success of the merge.
Thanks to @dahlbyk, the author of Posh-Git, for posting his config as a gist. It helped me resolve my configuration issue.
[diff]
tool = bc3
[difftool]
prompt = false
[difftool "bc3"]
cmd = \"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\"
[merge]
tool = bc3
[mergetool]
prompt = false
keepBackup = false
[mergetool "bc3"]
cmd = \"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
trustExitCode = true
[alias]
dt = difftool
mt = mergetool