Last updated: Apr 6, 2024
Reading time·3 min
The U
and M
file markers are Git decorations.
The letter U
stands for Untracked and the letter M
stands for
Modified.
Here are all of the Git markers in VS Code:
U
(Untracked) - A file has been added to your project or has been changed
but has not been committed to your Git repository. Untracked files have also
not been added to the staging area.M
(Modified) - An existing file that is tracked by Git has been changed.A
(Added) - A new file has been added to the staging area.D
(Deleted) - a file that is tracked by Git has been deleted.C
(Conflict) - the file contains a merge conflict.
R
(Renamed) - a file that is tracked by Git has been renamed. With recent
versions, VS Code marks files that have been renamed as U
(untracked).
Files that are Untracked (U
) or Added (A
) are colored in green.
Files that have been Modified (M
) are colored in brown/yellow.
Deleted (D
) files are colored in red.
You can use the git status
command to view which files have been added,
modified, deleted or are untracked.
If you need to open your terminal by using the Ctrl
+ ` (backtick) keyboard
shortcut.
git status
You can also use the Command Palette.
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.F1
to open the Command Palette.git status
command.git status
If you need to add all files to the staging area, use the git add .
command.
git add .
You can use the git commit
command to commit the changes.
git commit -m "your message"
You can also use the Source Control view in the sidebar to add and commit your changes to Git.
Press on the Source Control icon in the left sidebar.
Click on the plus icon to stage your changes.
Type a commit message into the field.
Click on the Commit button.
If you need to hide the Git file markers:
Ctrl
+ Shift
+ P
(or Command
+ Shift
+ P
on macOS).F1
to open the Command Palette.You can also open the settings screen by pressing Ctrl
+ ,
on Windows and
Linux or Cmd
+ ,
on macOS.
Once you disable the setting, git decorations are no longer shown.
I've also written an article on how to view the Git history in Visual Studio Code.
You can learn more about the related topics by checking out the following tutorials: