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

GitVisual Studio-Code

Git Problem Overview


Enter image description here

What do U and M mean in the image? I am using Visual Studio Code and Git. I did some search on the Internet, but I could not find anything on this.

Git Solutions


Solution 1 - Git

A - Added (This is a new file that has been added to the repository)

M - Modified (An existing file has been changed)

D - Deleted (a file has been deleted)

U - Untracked (The file is new or has been changed but has not been added to the repository yet)

C - Conflict (There is a conflict in the file)

R - Renamed (The file has been renamed)

S - Submodule (In repository exists another subrepository)

Solution 2 - Git

When you do a git status from your command line, it will give you a list of modified and untracked files that currently exist on your local machine.

The M and U in this case is just Visual Studio Code syncing up with Git and identifying (very nicely in the UI, I might add) which files have been modified and which files are untracked.

It's just a nice, clear and easy way to look through your workspace and see exactly what your current git status is without having to enter the command on the command line.

Please Note:

You will only ever see modified or untracked files highlighted in Visual Studio Code.

If you delete a file, for example, it will just disappear from your workspace, however your git status, when executed from the command line, will still include a deleted status for that file. But you won't see any additional visual representation for this in Visual Studio Code (the file will just not be listed in your workspace any more).

Solution 3 - Git

The 'U' means the files are 'untracked', and the 'M' means the files have been 'modified'.

You can use the commands:

git add -A - To add all the files to the staging area.

git commit -m 'message' - To create a 'snapshot' of the files on the staging area.

Hope this explains what you were trying to figure out.

Solution 4 - Git

You can disable this by going to: File -> Preferences -> Settings

find: "git.decorations.enabled" and change it to false

If you are not working with git find: "git.enabled" and change it to false

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionabhiView Question on Stackoverflow
Solution 1 - GitGeoView Answer on Stackoverflow
Solution 2 - GitAJC24View Answer on Stackoverflow
Solution 3 - GitMichiel J OttoView Answer on Stackoverflow
Solution 4 - GitSarah ShView Answer on Stackoverflow