git: Clean .gitignore(d) files from Repository

To keep a repository clean from temporary files, git users can create a file named .gitignore and define wildcards or absolute paths to let git ignore these files. This works for the most users as expected but it does not remove already checked in files. If you also want to clean up your existing repository from these ignored files, there is an easy way to get a list of ignored files.

Just enter the root of your git repository and enter the following to get a list of files which are otherwise ignored on a git status:

git ls-files -i --exclude-from=.gitignore

Thanks to VonC (stackoverflow).

Kommentar hinterlassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.