TIL: git clean

Keep your repos tidy.

Version: 66149d0

Today I learned that git will emit a list of files matching your .gitignore file if you execute,

!git clean -Xn
Would remove git.html

To remove those files, execute,

!git clean -Xf
Removing git.html

I’m almost always using git, so this saves me from writing a .PHONY: clean Makefile rule.

Learn more about git clean here.