Delete All .git Files Under Directory
Your hosting low on disk space, when you find the culprit, it was files under .git folders.
So if you don't need the git files anymore here is how to clean up.
Login to your server's shell, and then write:
find . | grep .git | xargs rm -rf
That should do the work and and we can gain more free space.
Written by Mochammad Masbuchin
Related protips
2 Responses
Another one using only find:
find <path_where> -type d -name '.git' -exec rm -rf {} \;
over 1 year ago
·
You forgot the asterisk :
-name "*.git"</code></pre>
You can even use the -delete option:
find <path_where> -type d -name '*.git' -delete</code></pre>
over 1 year ago
·
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#