I'm running git version 2.16.1 under macOS High Sierra 10.13.3 and when I
use git branch, the result is displayed through less. On the contrary, when I'm using git branch under Linux, the result is simply printed in stdout. How can I enforce git to work the same way it works in Linux?
Asked
Active
Viewed 670 times
0
Anastasios Andronidis
- 6,310
- 4
- 30
- 53
-
Close voters: this seems like a sane question to me; what's unclear about it? – Jules Feb 05 '18 at 18:33
-
Agree with @phd. Absolutely a duplicate. (Can't re-vote after retracting my previous one, though). – Jules Feb 05 '18 at 23:43
-
1Duplicates are helpful for search purposes – Cornelius Roemer Mar 20 '20 at 10:14
1 Answers
4
This is a result of varying defaults for the pager.branch setting in your Git configuration.
For a one-off pagerless git branch, run:
$ git branch --no-pager
To persistently disable the pager on a repo, run:
$ git config --local pager.branch "cat"
And if you want to set this globally, run:
$ git config --global pager.branch "cat"
The git-config docs outline this here.
It should go without saying that if you ever want to revert to using less (or more, or whatever other pager), just replace cat with that other pager in the last two commands.
Jules
- 14,200
- 13
- 56
- 101

