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

Git

Git Problem Overview


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

Git Solutions


Solution 1 - Git

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;

Solution 2 - Git

The code letters are listed in git-diff-files and git-diff-index under the --diff-filter option. They include these less common ones not listed under git-status.

> have their type (i.e. regular file, symlink, submodule, …) changed (T),

From git help diff-files msysgit version 1.7.8-preview20111206

Solution 3 - Git

> it isn't in the man page

It will be, with Git 2.34 (Q4 2021): a few kinds of changes "git status"(man) can show were not documented. There are now.

See commit d2a534c, commit 56c4d7f, commit 55e7f52, commit 1566cdd (04 Oct 2021) by Johannes Altmanninger (krobelus).
(Merged by Junio C Hamano -- gitster -- in commit 9875c51, 13 Oct 2021)

> ## Documentation/git-status: document porcelain status T (typechange)
> Signed-off-by: Johannes Altmanninger

> As reported in this issue, T is missing from the description of porcelain status letters in git-status (whereas T is documented in git-diff-files and friends).
> Document T right after M (modified) because the two are very similar.

git status now includes in its man page: > * 'T' = file type changed (regular file, symbolic link or submodule)

git status now includes in its man page: > M [ MTD] updated in index > T [ MTD] type changed in index > A [ MTD] added to index

git status now includes in its man page: > R [ MTD] renamed in index > C [ MTD] copied in index > [MTARC] index and work tree matches > [ MTARC] M work tree changed since index > [ MTARC] T type changed in work tree since index > [ MTARC] D deleted in work tree


The description stems from git diff-format, which has been updated:

See commit d2a534c, commit 56c4d7f, commit 55e7f52, commit 1566cdd (04 Oct 2021) by Johannes Altmanninger (krobelus).
(Merged by Junio C Hamano -- gitster -- in commit 9875c51, 13 Oct 2021)

> ## Documentation/diff-format: state in which cases porcelain status is T
> Signed-off-by: Johannes Altmanninger

> Porcelain status letter T is documented as "type of the file", which is technically correct but not enough information for users that are not so familiar with this term from systems programming.
> > In particular, given that the only supported file types are "regular file", "symbolic link" and "submodule", the term "file type" is surely opaque to the many(?) users who are not aware that symbolic links can be tracked - I thought that a "chmod +x" could cause the T status (wrong, it's M).
> > Explicitly document the three file types so users know if/how they want to handle this.

diff-format now includes in its man page: > > - T: change in the type of the file (regular file, symbolic link or submodule)

Solution 4 - Git

If you find binary files in your repo have changed, and you're not sure why, and you see typechange come up - it may mean that the mode, ie chmod, of the files has changed.

I had this pop up recently, and it wasn't immediately obvious what had changed, even after reverting to the previous commit. Only on creating a branch, and adding the reverted commits to it, did I see a message that revealed the mode had changed:

> mode change 100755 => 120000

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsdlinsView Question on Stackoverflow
Solution 1 - GitTom van der WoerdtView Answer on Stackoverflow
Solution 2 - GitPhilip OakleyView Answer on Stackoverflow
Solution 3 - GitVonCView Answer on Stackoverflow
Solution 4 - GitBrad ParksView Answer on Stackoverflow