Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a Java project and it used a SVN repository, now I decide to change to GIT.

However the problem is that SVN engine that I used created in every folder of the project the .svn metadata directory.

I want to clean all folders of the project of this hidden folder.

Is there any terminal command to search in folder and clean it ?

share|improve this question

5 Answers 5

up vote 15 down vote accepted

You will have to move to desire folder using cd command then write following command:

find -type d -name '.svn' -exec rm -rfv {} \;

This will remove the all svn files from current and sub-directories.

share|improve this answer

Another way of doing the same is:

rm -rf `find . -type d -name .svn`

share|improve this answer
1  
I wish Windows (I have has this same issue on that platform) had solutions that were this clean and easy :( –  Steven Apr 19 '11 at 12:30
    
There may be some script in Powershell, but I don't use Windows anymore ;-) –  Chakra Apr 19 '11 at 12:35
    
This fails for directories with spaces in the name –  enzotib Apr 19 '11 at 21:07

If it's still connected to svn just do svn export and it will copy the project with no svn metadata:)

share|improve this answer

For Windows :

  • either use UnxUtils http://unxutils.sourceforge.net/ with the previous answers
  • or use the search (F3) in explorer with ".svn" as the file name, it also worked for me
share|improve this answer

I have fond a solution by typing:

find ./ -name ".svn" | xargs rm -Rf
share|improve this answer
    
This is dangerous, when some dir can contain spaces in his name –  enzotib Apr 19 '11 at 21:09
    
Yes. Beware of spaces! –  hexafraction Aug 16 '12 at 23:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.