Git分支命令的行为类似于“少"

编程入门 行业动态 更新时间:2024-10-22 07:17:50
本文介绍了Git分支命令的行为类似于“少"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我使用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分支命令的行为类似于“少"

本文发布于:2023-10-18 11:06:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504060.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:类似于   分支   命令   Git   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!