Git分支命令的行为类似于“少" [英] Git branch command behaves like 'less'
问题描述
当我使用git branch
命令列出所有分支时,会看到git branch | less
的输出.
When I use the git branch
command to list all branches, I see the output of git branch | less
.
命令git branch
应该显示分支列表,就像ls
用于文件一样.
The command git branch
is supposed to show a list of branches, like ls
does for files.
这是我得到的输出:
如何获得git branch
的默认行为?导致页面输出的原因是什么?
How do I get the default behaviour of git branch
? What causes the paged output?
我将ZSH与oh_my_zsh
一起使用(那里没有Git),而我的.gitconfig
看起来像这样:
I am using ZSH with oh_my_zsh
(nothing for Git in there), and my .gitconfig
looks like this:
[user]
email = myemail@mail.com
name = Dennis Haegler
[push]
default = simple
[merge]
tool = vimdiff
[core]
editor = nvim
excludesfile = /Users/dennish/.gitignore_global
[color]
ui = true
[alias]
br = branch
ci = commit -v
cam = commit -am
co = checkout
df = diff
st = status
sa = stash
mt = mergetool
cp = cherry-pick
pl = pull --rebase
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh
\"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
推荐答案
As mentioned in comments to Mark Adelsberger's answer, this was a default behavior change introduced in Git 2.16.
默认情况下,您可以使用git branch的分页输出> pager.branch
配置设置:
You can turn paged output for git branch
back off by default with the pager.branch
config setting:
git config --global pager.branch false
这篇关于Git分支命令的行为类似于“少"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!