2

Reading the git-status man page, I read about the flags:

`R`: file renamed
`C`: file copied
`U`: file updated

But how would you ever get these flags in the git-status command. git mv, results in an A flag, there is no git cp. Are these flags deprecated?

hgiesel
  • 5,430
  • 2
  • 29
  • 56

1 Answers1

4

R and U are quite simple:

$ 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

But I don't know how to simulate C. In this answer https://stackoverflow.com/a/22798751/3691891 it says that it might be not possible today although it's still described in Documentation/git-status.txt in git source code.

Arkadiusz Drabczyk
  • 11,227
  • 2
  • 25
  • 38
  • If `git status` set various extra internal flags, or grew options to set them, *then* you could get `C` statuses. Unless and until that ever happens, you can't. – torek Dec 22 '18 at 17:57