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.
To ignore untracked files, you have a file in your git folder called . git/info/exclude . This file is your own gitignore inside your local git folder, which means is not going to be committed or shared with anyone else. You can basically edit this file and stop tracking any (untracked) file.
If git status mentions "Untracked files:", you may need to add one or more untracked files. This status message is OK. We are up-to-date, there is nothing to commit, but there is still an untracked file.
Untracked files are files that have been created within your repo's working directory but have not yet been added to the repository's tracking index using the git add command.
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.
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