I have a git repository, and I want git status
to ignore all directories (and everything below) if I haven't added files in the directory yet. Adding /*
to .gitignore
almost does the trick. I can create new directories, put files in them, and git status
will be completely oblivious.
So then I create a new directory and put a file there, "directory/file". Then I git add directory
, git commit
, and create a new file inside this directory, say, "directory/newfile". The problem is that git status
won't show me the new file.
I tried adding !/*/*
to .gitignore
but it didn't do anything as far as I could tell. How can I get git status
to show new files in directories with file that are tracked (added), while ignoring directories without tracked files?