当我使用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 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推荐答案
如评论Mark Adelsberger的答案,这是默认行为更改在Git 2.16中引入.
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分支命令的行为类似于“少"
发布评论