There is a red bar after + sign. What is this ?
Diff colors should show green for insert, red for delete · Issue #5430 · facebook/jest · GitHub.
Green if clean, red if dirty. GitHub.
Let's analyze a simple example -1,6 means that this piece of the first file starts at line 1 and shows a total of 6 lines. Therefore it shows lines 1 to 6. 1 2 3 4 5 6. - means "old", as we usually invoke it as diff -u old new . +1,4 means that this piece of the second file starts at line 1 and shows a total of 4 lines ...
Potentially bad indentation. You may have used tabs when you configured Git to prefer spaces, or vice-versa.
Check git config core.whitespace
; it might contain tab-in-indent
, space-before-tab
, or indent-with-non-tab
. You should change it to suit your preferences if this isn’t really a mistake.
Here are the possible values for the core.whitespace
.
Your configuration value will be one of the tabs value below
A comma separated list of common whitespace problems to notice.
git diff will usecolor.diff.whitespace
to highlight them, and git apply--whitespace=error
will consider them as errors.
You can prefix - to disable any of them (e.g. -trailing-space):
treats trailing whitespaces at the end of the line as an error (enabled by default).
treats a space character that appears immediately before a tab character in the initial indent part of the line as an error (enabled by default).
treats a line that is indented with space characters instead of the equivalent tabs as an error (not enabled by default).
treats a tab character in the initial indent part of the line as an error (not enabled by default).
treats blank lines added at the end of file as an error (enabled by default).
a short-hand to cover both blank-at-eol
and blank-at-eof
.
treats a carriage-return at the end of line as part of the line terminator, i.e. with it, trailing-space does not trigger if the character before such a carriage-return is not a whitespace (not enabled by default).
tells how many character positions a tab occupies; this is relevant for indent-with-non-tab and when Git fixes tab-in-indent errors. The default tab width is 8. Allowed values are 1 to 63.
Sample for output when tabs are uses as the configuration value:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With