Recursively delete .git directories
Here's a quick PSA: You probably don’t want to send all the git metadata in a project over the wire every time you deploy to production. That stuff really adds up, especially if you're using npm, composer or another package manager but most importantly any proprietary source code can be retained through git history.
So here's a one liner that will get rid of any .git directories from the current directory down.
find . | grep .git | xargs rm -rf
It's an old tip from my blog but one that's damn important for many developers.
Written by Montana Flynn
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#