Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable all paging in Git

I do all of my terminal work in Emacs and would prefer to use the much richer tools for moving around the output than "less". Worse, any time an applications pages inside of Emacs, it is horribly annoying, because it is a dumb terminal.

While I can swap things like "git help rm" for "M-x man git-rm", I would prefer to just disable all paging of everything in Git. Then I don't have to hunt for the right incantations.

git config --global core.pager cat

Doesn't seem to do the trick.

git config --global man.viewer "man -P cat"

causes problems because "man -P cat" isn't a valid executable.

How can I get Git to just dump its output?

like image 371
Travis Jensen Avatar asked Sep 08 '25 12:09

Travis Jensen


2 Answers

To disable pagination for all commands, set core.pager or GIT_PAGER to cat.

(c) git-config(1) Manual Page

You also asked about git help. It actually not a Git's pager, it is $MANPAGER. So maybe for you it will be enough just make PAGER=cat.

PAGER=cat git help log works without any pagers.

like image 104
kan Avatar answered Sep 10 '25 04:09

kan


From reading the git help man page, it looks like you should be able to

git config --global man.viewer catman
git config --global man.catman.cmd "man -P cat"

The man.viewer configuration value is a tool name, not a (partial) command line. Then man.catman.cmd gives the command to use for the catman tool.

It seems like setting core.pager to cat should take care of everything else.

like image 31
Geoff Reedy Avatar answered Sep 10 '25 06:09

Geoff Reedy