M、A 和 D 字母在 git checkout 后面代表什么含义?

huangapple go评论55阅读模式
英文:

What do the letters M, A, and D mean after git checkout

问题

我的控制台看起来像这样。

切换到分支 'main'
您的分支与 'origin/main' 保持一致。
user@dyn-128-59-6-239 proj % git branch new_branch
user@dyn-128-59-6-239 proj % git checkout new_branch
M	file1.json
A	file2.yml
M	file3.yml
D	file4.yml
切换到分支 'new_branch'

在文件列表的左侧,字母 M、A 和 D 代表什么意思?

我原本期望所有文件在新分支上与 main 分支相同。这是否意味着 main 分支和新分支之间出现了某种差异?

英文:

My console looks like this.

Switched to branch 'main'
Your branch is up to date with 'origin/main'.
user@dyn-128-59-6-239 proj % git branch new_branch
user@dyn-128-59-6-239 proj % git checkout new_branch
M	file1.json
A	file2.yml
M	file3.yml
D	file4.yml
Switched to branch 'new_branch'

What do the letters M, A, and D mean to the left of the files listed?

I was expecting all the files would be identical to main on a fresh branch. Does this mean there are differences between main and the new branch for some reason?

答案1

得分: 2

以下是翻译好的内容:

这一切都有文档记录 man git status。实际含义取决于字母是在第一列还是第二列,但通常它们表示与当前索引的更改:

  • M - 文件已修改
  • A - 新文件已添加
  • D - 文件已删除
英文:

It is all documented man git status. The actual meaning depends whether the letter is in the first column or the second, but in general those indicate the changes against the current index:

  • M - file is modified

  • A - new file added

  • D - file is deleted

huangapple
  • 本文由 发表于 2023年7月6日 22:45:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76630031.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定