在命令行中将 --no-color 设置为 git 的默认值

slt*_*son 4 git git-config

我正在研究终端中没有颜色的嵌入式系统(剥离的busybox)。当我使用 git 时,我总是要记住 --no-color 选项。

我知道我可以通过设置设置我的电子邮件

git config user.email
Run Code Online (Sandbox Code Playgroud)

但我似乎无法弄清楚如何做类似于 set 的事情,这样我就不必每次都添加它。

Mur*_*nik 5

color.ui 是您需要的选项:

$ git config color.ui false
Run Code Online (Sandbox Code Playgroud)

(另外,--global如果您在同一个盒子上有多个存储库,请考虑使用该标志)