9

Is there an option to git status so that untracked files won't be shown?

I tried git status -u no but that hides everything and tells:

"nothing to commit, working directory clean"

even thouh there are files both staged for commit and not staged for commit.

I want it to show only files staged for commit and modified ones but skip untracked files.

codekiddy
  • 5,897
  • 9
  • 50
  • 80

1 Answers1

15

You need:

git status -uno

i.e., without the space, or:

git status --untracked-files=no
Crowman
  • 25,242
  • 5
  • 48
  • 56
  • Huh, I misread git documentation about `-u no`, thank you for quick response Paul! that works great. – codekiddy Nov 15 '15 at 19:22
  • 1
    @codekiddy: It's a bit of an unexpected format, for sure. `cmd -uno` would normally be equivalent to `cmd -u -n -o`, but git appears to take a different view. – Crowman Nov 15 '15 at 19:24
  • 1
    Pro tip: All these options appear to do the same thing:`git status --untracked-files=no`, `git status --untracked-file=no`, `git status --untracked-fil=no`, `git status --untracked-fi=no`, `git status --untracked-f=no`, `git status --untracked=no`, `git status --untracke=no`, `git status --untrack=no`, `git status --untrac=no`, `git status --untra=no`, `git status --untr=no`, `git status --unt=no`, `git status --un=no`, `git status --u=no`. ‍♂️ – emallove Sep 11 '20 at 20:39