Does git “dirty” mean files not staged, or not committed? (glossary conflict)

前端 未结 3 1990
情书的邮戳
情书的邮戳 2020-12-31 03:49

https://www.kernel.org/pub/software/scm/git/docs/gitglossary.html#def_dirty A working tree is said to be \"dirty\" if it contains modifications which have not been committed

3条回答
  •  猫巷女王i
    2020-12-31 04:04

    From torek's answer:

    What git status tells you is both the answer to:

    • "what, if anything, is staged for commit" and
    • "what, if anything, is different between the work-tree and the index".

    Note that only the working tree is involved with git status, not the "working directory".

    Git 2.9.1+ (Q3 2016) will make that clearer.
    See commit 2a0e6cd (09 Jun 2016) by Lars Vogel (vogella).
    (Merged by Junio C Hamano -- gitster -- in commit a010d61, 27 Jun 2016)

    Use "working tree" instead of "working directory" for git status

    Working directory can be easily confused with the current directory.
    In one of my patches I already updated the usage of working directory with working tree for the man page but I noticed that git status also uses this incorrect term.

提交回复
热议问题