Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why does git use a pager for commands like diff/log and –help?

commands diff git help log pager
0
Posted

Why does git use a pager for commands like diff/log and –help?

0

Usually, you are not interested in the whole log, but only some bits at the beginning. It would not be useful for “git log” to simply let the output whiz by, leaving you looking at the uninteresting parts at the end. And if it did it the other way round, showing you the interesting bits last, it would waste a lot of time showing information that you are not interested in at all. So the only thing that makes sense is to look at the log in a pager. It also helps searching for keywords. Note that “–help” just spawns “man”, so it is not Git’s fault there. But you can use git help -w xxx to use a browser instead of “man” if the HTML documentation is installed. See the git help documentation for more information about this. If you do not like the pager default, you can set core.pager = cat with git config or tell your shell about GIT_PAGER=cat.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123