What are the U and M file markers in Visual Studio Code

avatar
Borislav Hadzhiev

Last updated: Apr 6, 2024
3 min

banner

# What are the U and M file markers in Visual Studio Code

The U and M file markers are Git decorations.

The letter U stands for Untracked and the letter M stands for Modified.

m u file markers

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.

added git decoration

  • D (Deleted) - a file that is tracked by Git has been deleted.

deleted marker

  • 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.

untracked added files marked green

Files that have been Modified (M) are colored in brown/yellow.

modified files marked brown

Deleted (D) files are colored in red.

deleted files colored in red

# Checking which files are Untracked or Modified with a git command

You can use the git status command to view which files have been added, modified, deleted or are untracked.

output of git status command

If you need to open your terminal by using the Ctrl + ` (backtick) keyboard shortcut.

shell
git status

You can also use the Command Palette.

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type toggle terminal and select View: Toggle Terminal.

vscode open terminal

  1. Issue the git status command.
shell
git status

If you need to add all files to the staging area, use the git add . command.

shell
git add .

You can use the git commit command to commit the changes.

shell
git commit -m "your message"

You can also use the Source Control view in the sidebar to add and commit your changes to Git.

  1. Press on the Source Control icon in the left sidebar.

  2. Click on the plus icon to stage your changes.

  3. Type a commit message into the field.

  4. Click on the Commit button.

add and commit changes

# Hiding the Git file markers in VS Code

If you need to hide the Git file markers:

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).
Note: you can also press F1 to open the Command Palette.
  1. Type user settings and select Preferences: Open User Settings.

open user settings

You can also open the settings screen by pressing Ctrl + , on Windows and Linux or Cmd + , on macOS.

  1. Type git decorations and uncheck the Git Decorations: Enabled checkbox.

hide git decorations

Once you disable the setting, git decorations are no longer shown.

git decorations no longer shown

I've also written an article on how to view the Git history in Visual Studio Code.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.