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?
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With