How to disable the git pager but just for certain commands?

I like having the pager enabled for git log for example, but not git diff because I have my own visual diff tool that comes up, and I hate having to hit 'q' at the command line after the diff is done with. Is there a way to do this?


You can set the pager.diff configuration variable to disable the pager for specific subcommands. See pager.<cmd> in git-config(1).

git config --global pager.diff false

Leave out --global if you only want to make this configuration change for the current repository.


Just add | cat to the end of your git call. This will trick git into dumping the whole thing as standard output (because no longer interactive).

e.g.

git diff --stat | cat

Sadly, you'll lose the color in your output, as a side-effect, but you can force it on by adding --color before the | cat, yielding:

git diff --stat --color | cat