git-branch命令的行为就像少一样 [英] git-branch command behaves like less

查看:139
本文介绍了git-branch命令的行为就像少一样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 git branch 命令列出所有分支时,我看到的是 git branch | less



命令 git branch 应该显示分支列表,比如 ls 用于文件。



这是我得到的输出:



git branch

$ C>?是什么导致分页输出?



我使用ZSH和 oh_my_zsh code> .gitconfig 看起来像这样。

  [user] 
email = myemail@mail.com
name = Dennis Haegler
[push]
default =简单
[合并]
工具= vimdiff
[核心]
editor = nvim
excludesfile = /Users/dennish/.gitignore_global
[color]
ui = true
[别名]
br =分支
ci = commit -v
cam = commit -am
co = checkout
df = diff
st = status
sa =隐藏
mt = mergetool
cp = cherry-pick
pl = pull --rebase
[difftoolsourcetree]
cmd = opendiff \$ LOCAL \\$ REMOTE\\ \\
[mergetoolsourcetree]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh
\$ LOCAL \\$ REMOTE \-ancestor \$ BASE \-merge \$ MERGED \
trustExi tCode = true


解决方案

如上所述,这是一个默认行为改变引入git 2.16。默认情况下,您可以将 git branch 的分页输出设置为:
git config --global pager.branch false


When I use the git branch command to list all branches, what I see is the output of git branch | less

The command git branch is supposed to show a list of branches, like ls does for files.

This is the output I get:

How I get the default behaviour of git branch? What causes the paged output?

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 above, this was a default behavior change introduced in git 2.16. You can turn paged output for git branch back off by default with: git config --global pager.branch false

这篇关于git-branch命令的行为就像少一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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