beyondtdr
beyondtdr

Reputation: 451

Visual Studio Code - git colors & project hierarchy

There are a lot of different colors for the different files in my project hierarchy but so far I have been unable to find an overview of what all of these colors mean. Where can I find more information on this?

Edit: Please see this screenshot:

colors

It has the colors red ("9+"), green ("U"), light yellow ("M"), dark yellow ("2"). Would be interested to have an overview of what all those colors refer to

Upvotes: 2

Views: 3288

Answers (2)

Omar AbdulGhani
Omar AbdulGhani

Reputation: 123

You are seeing a combination of git status decorations and error/warning decorations.

  • Git status decorations show up if your project is a Git repo. They indicate the current uncommitted status of files (like the output of git status).
  • Error/warning decorations show up if the file's language supports it. They represent the orange/red squiggly underlines in the text editor.

Configuring Git Decorations

  1. You can show/hide decorations with the git.decorations.enabled setting.
  2. You can show/hide colors with the explorer.decorations.colors setting.
  3. You can show/hide colors with the badges explorer.decorations.badges settings.

Decoration Meanings

- Badges on right side:

  1. (no badge) --> Unmodified
  2. M --> Modified
  3. A --> Added
  4. D --> Deleted
  5. R --> Renamed
  6. C --> Copied
  7. U --> Untracked (file exists but not added/staged yet)
  8. (number) --> number of errors (if red) or warnings (if orange)

- Color/style of filename:

  1. Green color --> Added or Untracked
  2. Yellow/Beige color --> Modified
  3. Transparent-ish --> Ignored (e.g. via .gitignore)
  4. Strikethrough --> Deleted
  5. Orange color --> file has warnings
  6. Red color --> file has errors

Examples

  1. The file at bottom ending in ".py" with the badge "9+" is indicating the file has red more than 9 errors.
  2. Notice the difference in color between the top two ".py" files. The first one with "2" is more orange, indicating the file contains 2 warnings. The second one with "M" is more beige, indicating the Git status is Modified.
  3. Regarding Green color: When you create a new file it will initially be shown in green color with "U." Once you stage that file but before you commit it, it will be shown in green with "A" instead. Once you commit, it will have no badge or color coding. Modifying it again later (after it's been committed once) will then give it the beige color with "M" badge.

I hope my explanation was clear and not boring😁. Have a good day😊

Upvotes: 5

carlfriedrich
carlfriedrich

Reputation: 4019

All these colors are depending on your theme, so there is no generic description of what the colors mean.

The colors for the git status have been introduced in v1.18 with the appended character being the short format of git status ("A"=added, "M"=modified).

A number next to a filename is an indicator for problems in that file. Even though it is not documented anywhere, the default theme colors are red for errors and yellow for warnings.

Upvotes: 1

Related Questions