I recently found out (the hard way :-) ) that running the following command prints an appropriate error on stderr but returns a zero exit code: > $ git diff --no-pager --exit-code > error: invalid option: --no-pager > $ echo $? > 0 I would expect a non-zero exit code to be returned. Interestingly, running `git diff --no-pager --exit-code HEAD` shows a usage instead and does return a non-zero exit code as expected. Thanks, -- Romain Chossart