Clean your git repo without losing ignored files
I found this one online, and it's been a real lifesaver when I decide I didn't want to run rake assets:precompile on my dev machine:
# in .gitconfig
[alias]
cleanse = "!git ls-files --others --exclude-standard | xargs rm"
Now you can remove all those new untracked files without losing critical-but-untracked files like database.yml or other local configs.
Written by Joshua Kovach
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#