I am slightly confused by the documentation. Kindly, correct me.
git status
- show the current local working directory status
git status -u
- show untracked files (also local)
git status -uno
- show no untracked files (also local) ??
I don't understand the last two. Any examples? Also, how do we show whether there are any changes remotely? So that I can decide whether to pull or not. I thought the last command helped me do that.. but apparently not anymore.
The -u
or --untracked-files=
flag to git status
takes an additional parameter that is one of three values:
no
: do not show untracked filesnormal
: show untracked files and directoriesall
: a more-verbose variant of normal
Omitting the additional word means the same as using -unormal
(or --untracked-files=normal
). So normal
is the default, while no
suppresses them entirely.
The additional verbosity with all
simply takes the form of enumerating every file within an untracked directory:
$ 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
Normally, -u
(aka -unormal
) has no effect on git status
. However, if you change your defaults (by, e.g., setting status.showUntrackedFiles
to no
), -u
will make git status
display untracked files, i.e., override your modified default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With