What are the U and M file markers in Visual Studio

2020-05-21 09:10发布

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.

3条回答
劫难
2楼-- · 2020-05-21 09:17

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

查看更多
不美不萌又怎样
3楼-- · 2020-05-21 09:35

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.

查看更多
We Are One
4楼-- · 2020-05-21 09:42

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)

查看更多
登录 后发表回答