阅读git-status man page ,我读到了有关标志的信息:
`R`: file renamed
`C`: file copied
`U`: file updated
但是你如何在 git-status 命令中获得这些标志。 git mv
,导致 A
标志,没有 git cp
。这些标志是否已弃用?
最佳答案
R
和 U
非常简单:
$ git init
$ touch ag
$ git add a
$ git commit -mm
$ git mv a b
$ git status --short
R a -> b
$ git init
$ touch a
$ git add a
$ git commit -mm
$ git checkout -b dev
$ echo a > a
$ git commit -amm
$ git checkout -
$ echo b > a
$ git commit -amm
$ git rebase dev
$ git status --short
UU a
但我不知道如何模拟C
。在这个答案中
https://stackoverflow.com/a/22798751/3691891它说这可能是
今天不可能,尽管它仍然在
git 源代码中的 Documentation/git-status.txt
。
关于git:你怎么可能在 git-status 中使用 `R` 、 `C` 和 `U` 标志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53896868/