我认为这是因为我的配置文件中的颜色设置,但我尝试更改它但无济于事。也许我这样做不对?
请注意,Git Bash 将分支颜色显示为绿色,但在窗口 cl 上它根本不显示!
$ git branch
* add_bower *<~~~ only the asterisk appears on the windows prompt.*
master
cmd 中的 git 应该可以正常工作。在放弃之前,我会检查你的 gitconfig local 和 gitconfig global 。
我要做的第一件事就是
git branch --color
or
git diff --color
您还可以使用-c选项 https://git-scm.com/docs/git#_options
git -c color.ui=always status
如果您看到颜色,那么可能发生的情况是您的本地 gitconfig 正在覆盖全局 gitconfig 中的设置
那时做一个
git config --local --edit
如果设置为 auto 或 true 而您仍然看不到颜色。将输出设置为始终。我推荐这个 b\c git 可能会犯错误并且不将 cmd 视为终端
from git 配置 https://www.kernel.org/pub/software/scm/git/docs/git-config.html:
如果设置为始终,则 git-diff(1)、git-log(1) 和 git-show(1)
将为所有补丁使用颜色。如果设置为 true 或 auto,则
命令仅在输出到终端时才使用颜色。默认值
为假。
like so
[color]
branch = always
diff = always
interactive = always
status = always
ui = always
希望这可以帮助!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)