views:

100

answers:

1

I have configured numerous .gitignore files to filter out many different unwanted files from a set of about 6,000 untracked files. I want to do 'git add .' when I've got my filtered list looking the way I want it.

But, then I want to disable the .gitignore filters temporarily to see what got left behind, and make sure there was nothing important accidentally filtered.

I know that git-clean includes an option to ignore .gitignore files - is there a similar option for git-status?

I could go through and delete all the .gitignore files, do the check, then restore them, but it seems there should be an easier way?

+4  A: 

Try using git ls-files --other - it should list all files that git doesn't know about; i.e. those files that aren't in the repository and aren't ignored by .gitignore.

You can also use git ls-files --ignored --exclude-standard to see what files git is explicitly ignoring.

Blair Holloway
Thank you for your reply - it seems that 'git-ls-files --other' also lists ignored files.Does that second command work if you're using distributed .gitignore files? E.g. separate .gitignore files located at different levels of the subdirectory tree? Would you have to specify --exclude-from=<> for each .gitignore in the tree? That would require a crafty find command methinks.
meowsqueak
Apparently you can use --exclude-standard to read the `.gitignore` file from each subdirectory. See here: http://stackoverflow.com/questions/466764/show-ignored-files-in-gitI'll update my answer to accomodate.
Blair Holloway
--exclude-standard is useful - thank you.
meowsqueak