When doing a git diff
, sometimes I want to use a different diff tool (like, for example, cmp
, or a homebrew word-diff program I have in my own bin directory).
Many diff-like programs have an option along the lines of
-D <diffprog>
to tell them to use that other diff or diff-like program instead.
I am aware of git-difftool and this question, but that's not quite what I was looking for. I'd very much rather not have to configure something in advance, and the nonstandard command I want to use today might not be the nonstandard command I want to use tomorrow. Ideally I'd like to be able to just do it, on a one-time basis, from the command line.
(Is it possible to configure difftool to be able to use multiple nonstandard tools not on the official list?)
If it's too much trouble to get git diff
to use my choice of diff tool, I could also use something like
git cat file | mydiff - file
I know there's no such command as "git cat". But the idea here is to manually compare the repo version of the file with the local one, given a git command to simply emit the repo (or, in other circumstances, the index) version of the file. Is there any such command?
Finally, if there isn't the hypothetical git diff -D diffprog
option I was asking about, and if there isn't anything like the "git cat" command I was hypothesizing, am I wrong to be wishing for them?
git difftool
? – Ventilategit cat
you're looking for is spelledgit show
, orgit cat-file -p
. – Cashbook