git Visual Studio Code 中的 U 和 M 文件标记是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/48304195/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:13:23  来源:igfitidea点击:

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

gitvisual-studio-code

提问by abhi

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.

图中的 U 和 M 是什么意思?我正在使用 Visual Studio Code 和 Git。我在互联网上进行了一些搜索,但我找不到任何关于此的信息。

回答by AJC24

When you do a git statusfrom your command line, it will give you a list of modifiedand untrackedfiles that currently exist on your local machine.

当你做一个git status从您的命令行,它会给你的清单modifieduntracked目前在本地计算机上存在的文件。

The Mand Uin 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 modifiedand which files are untracked.

在这种情况下,MU只是 Visual Studio Code 与 Git 同步并识别(在 UI 中非常好,我可能会添加)modified哪些文件是untracked.

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

这只是一种查看工作区并准确查看当前git status内容的好、清晰且简单的方法,而无需在命令行上输入命令。

Please Note:

请注意:

You will only ever see modifiedor untrackedfiles highlighted in Visual Studio Code.

在 Visual Studio Code 中,您只会看到modifieduntracked突出显示的文件。

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

例如,如果您删除一个文件,它只会从您的工作区中消失,但是您的git status,当从命令行执行时,仍将包含deleted该文件的状态。但是您不会在 Visual Studio Code 中看到任何额外的可视化表示(该文件将不再列在您的工作区中)。

回答by Georgia

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

A- 添加(这是一个已添加到存储库的新文件)

M- Modified (An existing file has been changed)

M- 修改(现有文件已更改)

D- Deleted (a file has been deleted)

D- 已删除(文件已被删除)

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

U- 未跟踪(文件是新的或已更改但尚未添加到存储库中)

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

C- Conflict(文件有冲突)

R- Renamed (The file has been renamed)

R- 重命名(文件已重命名)

回答by RealMJDev

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

“U”表示文件“未跟踪”,“M”表示文件已“修改”。

You can use the commands:

您可以使用以下命令:

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

git add -A- 将所有文件添加到暂存区。

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

git commit -m 'message'- 创建暂存区文件的“快照”。

Hope this explains what you were trying to figure out.

希望这能解释你想弄清楚的事情。