How to recursively remove .svn metadata folders?

24,334

Solution 1

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.

Solution 2

Another way of doing the same is:

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

Solution 3

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

Solution 4

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:
24,334

Related videos on Youtube

radu c
Author by

radu c

Updated on September 18, 2022

Comments

  • radu c
    radu c over 1 year

    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 ?

  • Steven
    Steven about 13 years
    I wish Windows (I have has this same issue on that platform) had solutions that were this clean and easy :(
  • Chakra
    Chakra about 13 years
    There may be some script in Powershell, but I don't use Windows anymore ;-)
  • enzotib
    enzotib about 13 years
    This fails for directories with spaces in the name
  • enzotib
    enzotib about 13 years
    This is dangerous, when some dir can contain spaces in his name
  • nanofarad
    nanofarad almost 12 years
    Yes. Beware of spaces!