Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make git branch show branches inline (version 2.17.1)

Tags:

git

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?

like image 647
Boris Yakubchik Avatar asked Jun 08 '18 15:06

Boris Yakubchik


People also ask

How do I list all branches in a repository?

You can list the remote branches associated with a repository using the git branch -r, the git branch -a command or the git remote show command. To see local branches, use the git branch command.

Which command is used to see all the branches?

Command #1: git branch -r This Git command will show you remote branches. The -r flag here is short for --remotes . This is the command I use personally. So if you want, you can just stop reading here and use git branch -r whenever you want to list remote git branches.


2 Answers

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.

like image 162
Rory O'Kane Avatar answered Oct 20 '22 16:10

Rory O'Kane


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

like image 8
Boris Yakubchik Avatar answered Oct 20 '22 15:10

Boris Yakubchik