git status vs git status -u vs git status -uno

Gra*_*ful 6 git

我对文档感到有些困惑.请帮助,纠正我.

git status - 显示当前的本地工作目录状态

git status -u - 显示未跟踪的文件(也是本地的)

git status -uno - 显示没有未跟踪的文件(也是本地的)?

我不明白最后两个.任何例子?另外,我们如何远程显示是否有任何变化?这样我就可以决定是否拉.我以为最后一个命令帮助我做到了......但显然不再这样了.

tor*_*rek 10

-u--untracked-files=以标志git status需要一个附加的参数,该参数是以下三个值之一:

  • no:不显示未跟踪的文件
  • normal:显示未跟踪的文件和目录
  • all:一个更冗长的变体 normal

省略附加单词意味着与使用-unormal(或--untracked-files=normal)相同.这normal是默认值,同时no完全抑制它们.

有额外的冗长all只是采用列举的每一个文件的形式未追踪目录:

$ git status
...
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    weeble/

no changes added to commit (use "git add" and/or "git commit -a")
$ git status -uall
...
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    weeble/file1
    weeble/file2
Run Code Online (Sandbox Code Playgroud)

通常,-u(aka -unormal)对此没有影响git status.但是,如果更改默认值(例如,设置status.showUntrackedFilesno),-ugit status显示未跟踪的文件,即覆盖修改后的默认值.