I'd like to use diff
as described here and in the documentation I see when I type man diff
. However, when I type diff
, what I get is this:
~ ❯❯❯ diff
usage: git diff --no-index <path> <path>
Similarly when I try to use diff
, I get git errors because -rq
is supported in man diff
but not by git diff
:
~ ❯❯❯ diff -rq ~/ ~/Desktop
fatal: invalid diff option/value: -rq
I'm using Prezto and hub which both help with git productivity, but neither creates an alias that doesn't at least start with g
, as far as I can tell.
I've run a few scripts like this to try to find something that's defining diff
to git diff
but to no avail.
How do I fix this/find what's causing it/override it?
Edit
Ran type diff
:
diff is a shell function
diff is /usr/bin/diff
Best Answer
This seems to be from prezto defining a function overriding
diff
. It may well have a way of disabling that, but I don't know what it is (but ericbn does!). You have a few options:/usr/bin/diff
orcommand diff
will both run thediff
command, rather than the function.unset -f diff
will remove thediff
function. You could put that in your shell configuration.colordiff
is installed it will be used in preference togit diff
by the function.This really seems like a misfeature in prezto.