我假设这是因为我的配置文件中的颜色设置,但我尝试更改它无济于事。也许我做得不对?
请注意,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
或
git diff --color
您还可以使用 -c option
git -c color.ui=always status
如果你看到颜色那么可能发生的是你的本地 gitconfig 覆盖了全局 gitconfig 中的设置
在那一点上做一个
git config --local --edit
如果显示为 auto 或 true 而您仍然看不到颜色。将输出设置为始终。我推荐这个 b\c git 可能会出错并且不将 cmd 视为终端
来自 git-config :
If this is set to always, git-diff(1), git-log(1), and git-show(1) will use color for all patches. If it is set to true or auto, those commands will only use color when output is to the terminal. Defaults to false.
像这样
[color]
branch = always
diff = always
interactive = always
status = always
ui = always
希望这对您有所帮助!
关于windows - Windows 命令提示符中不显示 Git 颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34241743/