Have a new .gitignore tell me if any file already matches tracked files

is there a way to parse .gitignore and tell me if I have files matching ignore so that I know to delete them or change my .gitignore?

For example, I have git tracking of my directory imgs, and I want to ignore all windows Thumbs.db, and also tell me if I have any data in my repository that can be tracked so that I can delete them.

+3
source share
1 answer

Give it a try git ls-files --ignored. You may have to play around with parameters, but this ls-filesis the right starting point for a script entry that matches files using exclusive patterns.

+3
source

Source: https://habr.com/ru/post/1774158/


All Articles