]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/config/color.txt
Merge branch 'js/ci-use-macos-13'
[thirdparty/git.git] / Documentation / config / color.txt
CommitLineData
0a7839e3
NTND
1color.advice::
2 A boolean to enable/disable color in hints (e.g. when a push
3 failed, see `advice.*` for a list). May be set to `always`,
4 `false` (or `never`) or `auto` (or `true`), in which case colors
5 are used only when the error output goes to a terminal. If
6 unset, then the value of `color.ui` is used (`auto` by default).
7
8color.advice.hint::
9 Use customized color for hints.
10
11color.blame.highlightRecent::
8c328561
BS
12 Specify the line annotation color for `git blame --color-by-age`
13 depending upon the age of the line.
0a7839e3 14+
8c328561
BS
15This setting should be set to a comma-separated list of color and
16date settings, starting and ending with a color, the dates should be
17set from oldest to newest. The metadata will be colored with the
18specified colors if the line was introduced before the given
19timestamp, overwriting older timestamped colors.
0a7839e3 20+
8c328561
BS
21Instead of an absolute timestamp relative timestamps work as well,
22e.g. `2.weeks.ago` is valid to address anything older than 2 weeks.
0a7839e3 23+
8c328561
BS
24It defaults to `blue,12 month ago,white,1 month ago,red`, which
25colors everything older than one year blue, recent changes between
26one month and one year old are kept white, and lines introduced
27within the last month are colored red.
0a7839e3
NTND
28
29color.blame.repeatedLines::
8c328561
BS
30 Use the specified color to colorize line annotations for
31 `git blame --color-lines`, if they come from the same commit as the
32 preceding line. Defaults to cyan.
0a7839e3
NTND
33
34color.branch::
35 A boolean to enable/disable color in the output of
36 linkgit:git-branch[1]. May be set to `always`,
37 `false` (or `never`) or `auto` (or `true`), in which case colors are used
38 only when the output is to a terminal. If unset, then the
39 value of `color.ui` is used (`auto` by default).
40
41color.branch.<slot>::
42 Use customized color for branch coloration. `<slot>` is one of
43 `current` (the current branch), `local` (a local branch),
44 `remote` (a remote-tracking branch in refs/remotes/),
45 `upstream` (upstream tracking branch), `plain` (other
46 refs).
47
48color.diff::
49 Whether to use ANSI escape sequences to add color to patches.
50 If this is set to `always`, linkgit:git-diff[1],
51 linkgit:git-log[1], and linkgit:git-show[1] will use color
52 for all patches. If it is set to `true` or `auto`, those
53 commands will only use color when output is to the terminal.
54 If unset, then the value of `color.ui` is used (`auto` by
55 default).
56+
57This does not affect linkgit:git-format-patch[1] or the
58'git-diff-{asterisk}' plumbing commands. Can be overridden on the
59command line with the `--color[=<when>]` option.
60
61color.diff.<slot>::
62 Use customized color for diff colorization. `<slot>` specifies
63 which part of the patch to use the specified color, and is one
64 of `context` (context text - `plain` is a historical synonym),
65 `meta` (metainformation), `frag`
66 (hunk header), 'func' (function in hunk header), `old` (removed lines),
67 `new` (added lines), `commit` (commit headers), `whitespace`
68 (highlighting whitespace errors), `oldMoved` (deleted lines),
69 `newMoved` (added lines), `oldMovedDimmed`, `oldMovedAlternative`,
70 `oldMovedAlternativeDimmed`, `newMovedDimmed`, `newMovedAlternative`
71 `newMovedAlternativeDimmed` (See the '<mode>'
72 setting of '--color-moved' in linkgit:git-diff[1] for details),
73 `contextDimmed`, `oldDimmed`, `newDimmed`, `contextBold`,
74 `oldBold`, and `newBold` (see linkgit:git-range-diff[1] for details).
75
76color.decorate.<slot>::
77 Use customized color for 'git log --decorate' output. `<slot>` is one
78 of `branch`, `remoteBranch`, `tag`, `stash` or `HEAD` for local
79 branches, remote-tracking branches, tags, stash and HEAD, respectively
80 and `grafted` for grafted commits.
81
82color.grep::
83 When set to `always`, always highlight matches. When `false` (or
84 `never`), never. When set to `true` or `auto`, use color only
85 when the output is written to the terminal. If unset, then the
86 value of `color.ui` is used (`auto` by default).
87
88color.grep.<slot>::
89 Use customized color for grep colorization. `<slot>` specifies which
90 part of the line to use the specified color, and is one of
91+
92--
93`context`;;
94 non-matching text in context lines (when using `-A`, `-B`, or `-C`)
95`filename`;;
96 filename prefix (when not using `-h`)
97`function`;;
98 function name lines (when using `-p`)
99`lineNumber`;;
100 line number prefix (when using `-n`)
101`column`;;
102 column number prefix (when using `--column`)
103`match`;;
104 matching text (same as setting `matchContext` and `matchSelected`)
105`matchContext`;;
106 matching text in context lines
107`matchSelected`;;
6a5c3379 108 matching text in selected lines. Also, used to customize the following
4d542687 109 linkgit:git-log[1] subcommands: `--grep`, `--author`, and `--committer`.
0a7839e3 110`selected`;;
6a5c3379
HM
111 non-matching text in selected lines. Also, used to customize the
112 following linkgit:git-log[1] subcommands: `--grep`, `--author` and
113 `--committer`.
0a7839e3
NTND
114`separator`;;
115 separators between fields on a line (`:`, `-`, and `=`)
116 and between hunks (`--`)
117--
118
119color.interactive::
120 When set to `always`, always use colors for interactive prompts
121 and displays (such as those used by "git-add --interactive" and
122 "git-clean --interactive"). When false (or `never`), never.
123 When set to `true` or `auto`, use colors only when the output is
124 to the terminal. If unset, then the value of `color.ui` is
125 used (`auto` by default).
126
127color.interactive.<slot>::
128 Use customized color for 'git add --interactive' and 'git clean
129 --interactive' output. `<slot>` may be `prompt`, `header`, `help`
130 or `error`, for four distinct types of normal output from
131 interactive commands.
132
133color.pager::
a84216c6
JK
134 A boolean to specify whether `auto` color modes should colorize
135 output going to the pager. Defaults to true; set this to false
136 if your pager does not understand ANSI color codes.
0a7839e3
NTND
137
138color.push::
139 A boolean to enable/disable color in push errors. May be set to
140 `always`, `false` (or `never`) or `auto` (or `true`), in which
141 case colors are used only when the error output goes to a terminal.
142 If unset, then the value of `color.ui` is used (`auto` by default).
143
144color.push.error::
145 Use customized color for push errors.
146
147color.remote::
148 If set, keywords at the start of the line are highlighted. The
149 keywords are "error", "warning", "hint" and "success", and are
150 matched case-insensitively. May be set to `always`, `false` (or
151 `never`) or `auto` (or `true`). If unset, then the value of
152 `color.ui` is used (`auto` by default).
153
154color.remote.<slot>::
155 Use customized color for each remote keyword. `<slot>` may be
156 `hint`, `warning`, `success` or `error` which match the
157 corresponding keyword.
158
159color.showBranch::
160 A boolean to enable/disable color in the output of
161 linkgit:git-show-branch[1]. May be set to `always`,
162 `false` (or `never`) or `auto` (or `true`), in which case colors are used
163 only when the output is to a terminal. If unset, then the
164 value of `color.ui` is used (`auto` by default).
165
166color.status::
167 A boolean to enable/disable color in the output of
168 linkgit:git-status[1]. May be set to `always`,
169 `false` (or `never`) or `auto` (or `true`), in which case colors are used
170 only when the output is to a terminal. If unset, then the
171 value of `color.ui` is used (`auto` by default).
172
173color.status.<slot>::
174 Use customized color for status colorization. `<slot>` is
175 one of `header` (the header text of the status message),
176 `added` or `updated` (files which are added but not committed),
177 `changed` (files which are changed but not added in the index),
178 `untracked` (files which are not tracked by Git),
179 `branch` (the current branch),
180 `nobranch` (the color the 'no branch' warning is shown in, defaulting
181 to red),
182 `localBranch` or `remoteBranch` (the local and remote branch names,
183 respectively, when branch and tracking information is displayed in the
184 status short-format), or
185 `unmerged` (files which have unmerged changes).
186
187color.transport::
188 A boolean to enable/disable color when pushes are rejected. May be
189 set to `always`, `false` (or `never`) or `auto` (or `true`), in which
190 case colors are used only when the error output goes to a terminal.
191 If unset, then the value of `color.ui` is used (`auto` by default).
192
193color.transport.rejected::
194 Use customized color when a push was rejected.
195
196color.ui::
197 This variable determines the default value for variables such
198 as `color.diff` and `color.grep` that control the use of color
199 per command family. Its scope will expand as more commands learn
200 configuration to set a default for the `--color` option. Set it
201 to `false` or `never` if you prefer Git commands not to use
202 color unless enabled explicitly with some other configuration
203 or the `--color` option. Set it to `always` if you want all
204 output not intended for machine consumption to use color, to
205 `true` or `auto` (this is the default since Git 1.8.4) if you
206 want such output to use color when written to the terminal.