为什么git branch不显示任何内容? [英] Why git branch doesn't display anything?

查看:251
本文介绍了为什么git branch不显示任何内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用github建立存储库.当我执行 git branch 时,屏幕上没有显示任何内容(请参见下面的图片).

I am working on a repository with github. When I execute git branch, there isn't anything displaied on my screen (see picture bellow).

git分支

当我执行 git status 时,据说我在一个分支中.

When I execute git status, it is said I'm in a branch.

git状态

所以有一些分支机构,我正在与他们合作.
您知道如何解决此问题吗?

So there is some branches and I am working with them.
Do you know how to fix this issue ?

推荐答案

git branch 通过您选择的 pager 运行其分支列表.如果寻呼机设置有问题,则可能会吃掉"寻呼机.输出,产生您看到的结果.如果 git --no-pager分支正常工作,那就是问题.

git branch runs its list of branches through your chosen pager. If there is something wrong with the pager setup, this could "eat" the output, producing the result you see. If git --no-pager branch works correctly, this is the problem.

解决方案是修复您的寻呼机.首先,找出您选择的寻呼机:运行 git var GIT_PAGER .输出是您选择的寻呼机.这可能来自:

The solution is to fix your pager. First, figure out which pager you chose: run git var GIT_PAGER. The output is the pager you chose. This could come from:

  • 环境变量 GIT_PAGER :如果已设置,则为您的寻呼机.
  • 您的配置,即 git config --get core.pager :如果已设置,则这是您的默认寻呼机.
  • Git内置的值.如果既未设置 GIT_PAGER ,也未设置 core.pager ,则Git将使用此功能.
  • The environment variable GIT_PAGER: if this is set, this is your pager.
  • Your configuration, i.e., git config --get core.pager: if this is set, this is your default pager.
  • The value built into Git. If neither GIT_PAGER nor core.pager are set, this is what Git will use.

此寻呼机的目标是防止长输出命令的输出滚动到屏幕之外/超出窗口的调用范围.(即使在一个窗口中有10,000条召回行,某些命令也可能产生更多的输出.)不好的寻呼机设置虽然没什么好玩的,但好的设置可能会很有帮助,因此请找出您喜欢和喜欢的寻呼机如何使用它们,并配置Git设置以使用最喜欢的寻呼机.

The goal of this pager is to keep the output from a long-output-command from scrolling away off your screen / out of the recall range of your window. (Even with, e.g., 10,000 recall lines in a window, some commands can produce more output than that.) A bad pager setting is no fun but a good one can be very helpful, so figure out which pager(s) you like and how to use them, and configure your Git setup to use the pager you like best.

这篇关于为什么git branch不显示任何内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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