我试图更改状态信息的颜色,但现在不起作用 [英] I tried to change the color of the status info, it does not work now

查看:30
本文介绍了我试图更改状态信息的颜色,但现在不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在显示状态信息时,我尝试使颜色有所不同,但是我确实设法毁了一些东西.当我输入git status来查看未暂存的文件和内容时,答复为: 致命:C:/....= gitconfig中无效的'color.status'数字配置值'blue' 仍然添加并提交工作.如何重置我的设置? (我是git的新手) 感谢您的回答!

I tried to make colors a bit different while displaying status info, but I did manage to ruin something. When I type git status to see my unstaged files and stuff, the reply is : fatal: bad numeric config value 'blue' for 'color.status' in C:/....=gitconfig: invalid unit add and commit work still. How can i reset my settings? (I am new to git) Thanks for the answers!

推荐答案

运行git config --global color.status always. 我认为您不小心将其设置为无效值.

Run git config --global color.status always. I think you accidentally set it to an invalid value.

引用手册页(可在git-scm网站上的man git-config中读取):

Quoting the man page (readable in man git-config or on the git-scm site):

 color.status
   A boolean to enable/disable color in the output of git-status(1).
   May be set to always, false (or never) or auto (or true), in which
   case colors are used only when the output is to a terminal. 
   Defaults to false.

更新:

以下是一些设置各个颜色的示例:

Here are some examples to set the individual colors:

git config --global color.status.added magenta
git config --global color.status.changed blue
git config --global color.status.untracked yellow

以及color.status.<slot>的文档:

使用自定义颜色进行状态着色.
<slot>标头(状态消息的标头文本)之一, 已添加已更新(已添加但未提交的文件), 已更改(已更改但未添加到索引中的文件), 未跟踪(Git无法跟踪的文件), 分支(当前分支), 或 nobranch (nobranch )(显示无分支警告的颜色,默认为红色).

Use customized color for status colorization.
<slot> is one of header (the header text of the status message), added or updated (files which are added but not committed), changed (files which are changed but not added in the index), untracked (files which are not tracked by Git), branch (the current branch), or nobranch (the color the no branch warning is shown in, defaulting to red).

有关可能的颜色值的信息:

And info about the possible color values:

这些配置变量的值是颜色列表(在 最多两个)和属性(最多一个),以空格分隔.这 接受的颜色为正常,黑色,红色,绿色,黄色,蓝色, 洋红色,青色和白色;属性为粗体,暗淡,ul,闪烁和 撤销.给定的第一个颜色是前景色;第二个是 背景.属性的位置(如果有)无关紧要.

The value for these configuration variables is a list of colors (at most two) and attributes (at most one), separated by spaces. The colors accepted are normal, black, red, green, yellow, blue, magenta,cyan and white; the attributes are bold, dim, ul, blink and reverse. The first color given is the foreground; the second is the background. The position of the attribute, if any, doesn't matter.

颜色(前景和背景)也可能以数字形式给出 在0到255之间;这些使用ANSI 256色模式(但请注意, 所有终端都可以支持此功能.

Colors (foreground and background) may also be given as numbers between 0 and 255; these use ANSI 256-color mode (but note that not all terminals may support this).

这篇关于我试图更改状态信息的颜色,但现在不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆