Git分支命令的行为类似于“少" [英] Git branch command behaves like 'less'

查看:78
本文介绍了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.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆