11

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 ?

5 Answers 5

20

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.

0
3

Another way of doing the same is:

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

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

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

1

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
0

I have fond a solution by typing:

find ./ -name ".svn" | xargs rm -Rf
2
  • This is dangerous, when some dir can contain spaces in his name
    – enzotib
    Apr 19, 2011 at 21:09
  • Yes. Beware of spaces!
    – nanofarad
    Aug 16, 2012 at 23:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .