How do you git show untracked files that do not exist in .gitignore
GitGit Problem Overview
I'm using git status -u
to show untracked files. And on the terminal, I see plenty untracked files that I need to be untracked such as unit tests, personal documentation, etc. I have put them in .gitignore
, but it seems that git status
still shows them.
How do you show only untracked files that don't exist in .gitignore
.
Git Solutions
Solution 1 - Git
You can explicitly list what is being tracked and untracked as follows to see if Git is seeing and honoring your .gitignore
. If you post your .gitignore
contents, git status
output, and dir
or ls
we can better assist you.
List ignored files
$ git ls-files . --ignored --exclude-standard --others
List untracked files
$ git ls-files . --exclude-standard --others
Solution 2 - Git
Use:
git config status.showuntrackedfiles no
Solution 3 - Git
git update-index --no-assume-unchanged <file>