我对文档有点困惑,请帮助我纠正。
git status
- 显示当前本地工作目录状态
git status -u
- 显示未跟踪的文件(也是本地)
git status -uno
- 不显示未跟踪的文件(也是本地)??
我不明白最后两个命令。有没有一些例子?另外,如何显示远程是否有任何更改?这样我就可以决定是否拉取了。我以为最后一个命令可以帮助我做到这一点...但显然不再可以。
我对文档有点困惑,请帮助我纠正。
git status
- 显示当前本地工作目录状态
git status -u
- 显示未跟踪的文件(也是本地)
git status -uno
- 不显示未跟踪的文件(也是本地)??
我不明白最后两个命令。有没有一些例子?另外,如何显示远程是否有任何更改?这样我就可以决定是否拉取了。我以为最后一个命令可以帮助我做到这一点...但显然不再可以。
-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
通常情况下,-u
(即-unormal
)对git status
没有影响。但是,如果您更改了默认设置(例如通过将status.showUntrackedFiles
设置为no
),-u
将使git status
显示未跟踪的文件,即覆盖修改后的默认值。
git fetch
,然后决定是否合并。(pull = fetch + merge
) - Jonathon Reinhart