最佳答案
这似乎是远程边带输出,这意味着您需要:
- Git 2.19+
-
git config color.remote.error "red bold"
-
git config color.remote always
这将为 Remote 正在生成的内容着色。
但在您的情况下,如果错误消息不是由 Remote 生成,则颜色将由 color.interactive.<slot>
管理:
git config color.interactive.error "red bold"
(错误“failed to push to remote...
”很可能由您的本地 Git 实例产生,而不是由远程边带输出产生)
或者,正如 OP 评论的那样: color.push.error
:
git config color.push.error "red bold"
在这两种情况下,这是一个本地颜色设置,而不是远程颜色设置。
关于git - 标题不被接受 : How to set the color for error messages,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54955196/