gtcsbw
Last Updated: February 25, 2016
·
163
· buchin
Fc98a096fb23cd5f5231b4f25abfcd7e

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.

Say Thanks
Respond

2 Responses
Add your response

24451
0 zvbmg3vb1xzlunt9zycagcilay0rucl9brpagc1zamihppqnmpbcugbn0 xffrkvqj5kdltvuuy1

Another one using only find:

find <path_where> -type d -name '.git' -exec rm -rf {} \;
over 1 year ago ·
24489
Gravatar

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 ·
Filed Under