18

Before git version 2.17.1 (no more than 4 versions back), when you ran

git branch

you would get an inline list of branches and your terminal was ready for a new command.

In version 2.17.1 you get a list of branches as a new screen, and have to press q to quit it. After you quit, you no longer see your branches.

Without downgrading, how can I list branches inline as before?

Boris Yakubchik
  • 2,387
  • 1
  • 24
  • 30
  • 1
    See https://stackoverflow.com/a/8883248/3906760 – MrTux Jun 08 '18 at 15:03
  • 4
    Possible duplicate of [git-branch command behaves like less](https://stackoverflow.com/questions/48341920/git-branch-command-behaves-like-less) – phd Jun 08 '18 at 16:13

2 Answers2

40

The config setting pager.<cmd> works for me:

git config --global pager.branch 'false'

Before running that command, git branch used a pager. After that command, git branch printed the list of branches directly to the terminal.

Rory O'Kane
  • 25,436
  • 11
  • 86
  • 123
7

You can force the desired behavior with the --no-pager flag

git --no-pager branch

or edit .gitconfig to include this

[pager]
    branch = false

which will disable the new behavior

Boris Yakubchik
  • 2,387
  • 1
  • 24
  • 30