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

set --no-color to default for git in the command line

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

我知道我可以通过设置设置我的邮箱

git config user.email

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

color.ui是您需要的选项:

$ git config color.ui false

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