DEV.MD / Developer Network
Search:     Advanced search
Browse by category:
Glossary | Contact Us

Detach a working copy from SVN or CVS

Add comment
Views: 1739
Votes: 1
Comments: 0
Posted: 29 Apr, 2008
by: Zavadschi S.
Updated: 14 Jul, 2009
by: Zavadschi S.

In order to detach a working copy of some code and get the clean structure, without the .svn (.cvs) folders you may use something like:

find . -name ".svn" | xargs rm -rf
The problem is that if any of the paths that are returned by find have a space in them, rm tosses everything up to the space.

In other words, if you have something like this:

/Documents/Projects/My Really Important Stuff/Project1

and "My Really Important Stuff" contains more than just Project1, you can kiss it all goodbye.

The much safer way is:

find . -name ".svn" | while read f; do rm -r "$f" ; done
Others in this Category
document Remove Empty Lines and Comments
document Lab Exam and sample solutions
document Standard Input and Output Redirection
document Remove path from find result in Bash



RSS