« Telefónica and Microsoft against Skype | Home | I'm getting married! »

November 9, 2008

Remove .svn folders command linux/mac

You know that the only way to download a repo from subversion without all those .svn folders it to do an export, but what happens if you don't have internet access but you have the repo locally? That happened to us and this is how we fix it.

Actually we fixed it manually since we needed to update some files only on the client's webserver but here is how you can remove all those hidden svn folders and files from your repo.

First create a copy of your local repo in order to not lose the local repo setup. You can do that with a plain "cp -r".

Now go into your repo copy and execute this command:

find . -type d -name .svn -depth -exec rm -rf {} \;

In words it is read like:

"find" in this folder "." all directories "-type d" which name is .svn "-name .svn", order them from parent -> child "-depth" and execute "-exec" the following command "rm -rf" to that current file "{}" and pass ending character to command ";" (escaped "\;")

Nice huh?

--fernando

4 Comments

You can also do it via rsync:

rsync -aC --exclude .svn target dest

Is there any way to do that on Windows, I hate to delete all files manually!

Or using tortoiseSVN for the hard job :)

About this Entry

This page contains a single entry by fernando published on November 9, 2008 11:29 PM.

Telefónica and Microsoft against Skype was the previous entry in this blog.

I'm getting married! is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.