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

后端 未结 2 351
温柔的废话
温柔的废话 2020-12-24 10:02

When I type git status I see:

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

What exactly does the T git status

相关标签:
2条回答
  • 2020-12-24 10:47

    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

    0 讨论(0)
  • 2020-12-24 10:58

    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;
    
    0 讨论(0)
提交回复
热议问题