git clean04 Feb 2016
The use of .gitignore files with git makes the maintenance of a tidy repository a much easier experience, however it does have the side effect of hiding any built files that you may wish to clean away. For example, in a Python project, the .pyc byte code files generated can clutter up the directory, and when building software with compiled languages there are often many built object files that you may wish to discard.
That’s where the
git clean command comes in handy. To remove all files not
under version control, run:
or, to remove only files in .gitignore (thereby keeping any untracked files)
git status), run: