How do I do a 'git status' so it doesn't display untracked files without using .gitignore?

GitVersion Control

Git Problem Overview


How do I do a git status so it doesn't display untracked files without using .gitignore? I want to get modification status information on tracked files only.

Git Solutions


Solution 1 - Git

Use this:

git status -uno

which is equivalent to:

git status --untracked-files=no

It's a bit hidden in the manuals, but the manpage for status says "supports the same options as git-commit", so that's where you'd have to look.

Solution 2 - Git

Also:

git config status.showuntrackedfiles no

Solution 3 - Git

Note that, since git 1.8.3 (April, 22d 2013), you will know about the --untracked-files=no even if you didn't add that option in the first place!

> "git status" suggests users to look into using --untracked-files=no option when it takes too long.

See commit https://github.com/git/git/commit/5823eb2b28696bf0eb25f6ca35b303447869f85:

> In some repositories users experience that "git status" command takes long time.
The command spends some time searching the file system for untracked files.

> Explain the trade-off struck by the default choice of normal to help users make an appropriate choice better, before talking about the configuration variable.

The git status documentation now states:

> When -u option is not used, untracked files and directories are shown (i.e. the same as specifying normal), to help you avoid forgetting to add newly created files.
Because it takes extra work to find untracked files in the filesystem, this mode may take some time in a large working tree.
You can use no to have git status return more quickly without showing untracked files
.

> The default can be changed using the status.showUntrackedFiles configuration variable documented in git config.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRoss RogersView Question on Stackoverflow
Solution 1 - GitDaniel BruceView Answer on Stackoverflow
Solution 2 - GitBombeView Answer on Stackoverflow
Solution 3 - GitVonCView Answer on Stackoverflow