Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "T" mean in "git status"? (it isn't in the man page)

Tags:

git

When I type git status I see:

T /path/to/file... M /path/to/otherfile... 

What exactly does the T git status mean?

I tried man git-status (I think it should be there, but isn't).

like image 518
sdlins Avatar asked Jan 01 '12 00:01

sdlins


People also ask

What does git status mean?

The git status command displays the state of the working directory and the staging area. It lets you see which changes have been staged, which haven't, and which files aren't being tracked by Git.

What does M mean in git status?

^M represents carriage return. This diff means something removed a Unicode BOM from the beginning of the line and added a CR at the end.

How do I see my git status?

To check the status, open the git bash, and run the status command on your desired directory. It will run as follows: $ git status.

What does C mean in git?

C: copy of a file into a new one D: deletion of a file M: modification of the contents or mode of a file R: renaming of a file T: change in the type of the file X: "unknown" change type (most probably a bug, please report it)


1 Answers

It means that the type of a file changed. For example, a symbolic link that became a regular file.

As far as I know, this only applies to symlinks, submodules and regular files

Edit
A source was requested for this information. While this is simply information that's in my head, I was able to find a few references to it on the internet. The most prominent one was a git changelog mentioning "T" as a type change and "D" as a deletion.

Edit 2 (updating this because it's my highest rating answer so far)
As pointed out by @PhilipOakley, man git-diff-files actually does show this information.

Possible status letters are:

  • A: addition of a file
  • C: copy of a file into a new one
  • D: deletion of a file
  • M: modification of the contents or mode of a file
  • R: renaming of a file
  • T: change in the type of the file
  • U: file is unmerged (you must complete the merge before it can be committed)
  • X: "unknown" change type (most probably a bug, please report it)

As pointed out by @Mat, it's also in diff.h, line 289:

#define DIFF_STATUS_TYPE_CHANGED    'T' 

And in wt-status.c, line 282:

case DIFF_STATUS_TYPE_CHANGED:     status_printf_more(s, c, _("typechange: %s"), one);     break; 
like image 194
Tom van der Woerdt Avatar answered Oct 12 '22 20:10

Tom van der Woerdt