Question: how to have ls-files use the .gitignore in the index
- From
- Holding, Lawrence <lawrence.holding@cubic.com>
- Date
- Apr 2, 2012, 23:07 UTC
- Message-ID
- <A5E8E180685CEF45AB9E737A010799805DFACA@cdnz-ex1.corp.cubic.cub>
I have a pre-commit hook that checks the index for files that match the ignores / excludes in the repository. But sometimes this will run on a repository where not all the folders are up-to-date with the tip, and will then test against the working tree versions of these files and not those in the index.
from pre-commit:
if git ls-files -i --exclude-standard | grep . then exit 1 fi
Is there an option to have ls-files use the excludes in the index without checking out the whole file tree?
Thanks,