When I type git diff
, I want to view the output with my visual diff tool of choice (SourceGear \"diffmerge\" on Windows). How do I configure git to do this?
If you happen to already have a diff tool associated with filetypes (say, because you installed TortoiseSVN which comes with a diff viewer) you could just pipe the regular git diff
output to a "temp" file, then just open that file directly without needing to know anything about the viewer:
git diff > "~/temp.diff" && start "~/temp.diff"
Setting it as a global alias works even better: git what
[alias]
what = "!f() { git diff > "~/temp.diff" && start "~/temp.diff"; }; f"