My organization made plenty of mistakes early on with git (storing binary objects, etc). We have re-done our .gitignore strategy to prevent binary objects (dll's, jars, zips) etc. from being committed.
What is the best way to identify files that are are currently version controlled, that would no longer be version controlled under the newly created .gitignore?
I would use ls-files:
git ls-files -i --exclude-standard
This shows committed files that would be ignored by standard git rules (i.e. according to .git/info/exclude, .gitignore in each directory, and the user’s global exclusion file).
If you want to test a particular ignore file, you can use the -X parameter to specify the file:
git ls-files -i -X .\.gitignore
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