颜色名称的语法

时间:2018-04-29 12:24:55

标签: git

name中使用git config --get-color name的语法是什么?

我尝试了以下内容来查找[status] added的内置默认颜色,但都没有返回任何内容:

git config --get-color status.added
git config --get-color color.status.added
git config --get-color color.added

1 个答案:

答案 0 :(得分:1)

语法为:(见git config color.status.<slot>

git config --get-color color.status.added

但如果它什么都不返回,那只是意味着它使用该槽的默认颜色。

请参阅&#34; Colors in Git&#34;。

默认颜色在wt-status.c中定义:

static char default_wt_status_colors[][COLOR_MAXLEN] = {
    GIT_COLOR_NORMAL, /* WT_STATUS_HEADER */
    GIT_COLOR_GREEN,  /* WT_STATUS_UPDATED */
    GIT_COLOR_RED,    /* WT_STATUS_CHANGED */
    GIT_COLOR_RED,    /* WT_STATUS_UNTRACKED */
    GIT_COLOR_RED,    /* WT_STATUS_NOBRANCH */
    GIT_COLOR_RED,    /* WT_STATUS_UNMERGED */
    GIT_COLOR_GREEN,  /* WT_STATUS_LOCAL_BRANCH */
    GIT_COLOR_RED,    /* WT_STATUS_REMOTE_BRANCH */
    GIT_COLOR_NIL,    /* WT_STATUS_ONBRANCH */
};