当我使用git branch命令列出所有分支时,我看到git branch | less.
git branch
git branch | less
该命令git branch应该显示分支列表,就像ls文件一样。
ls
这是我得到的输出:
如何获得 的默认行为git branch?是什么导致分页输出?
我正在使用 ZSH oh_my_zsh(那里没有 Git),我.gitconfig看起来像这样:
oh_my_zsh
.gitconfig
[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
您可以使用配置设置git branch默认关闭分页输出:pager.branch
pager.branch
git config --global pager.branch false
正如对 Mark Adelsberger 的回答的评论中提到的,这是Git 2.16 中引入的默认行为更改。