PDA

View Full Version : How can I remove a file from svn without deleting the file?



kerryhall
March 17th, 2009, 05:19 AM
How can I remove a file, or in this case, a huge tree of files and folders from svn, without actually deleting the files?

I checked out a bunch of files from one repo, now I need to get rid of their "svn" status so that I can put them into another repo. How do I do this?

I was thinking that I have to delete the ".svn" folder in every directory. Anyone want to give me a bash script that does this?

Thanks!

myrtle1908
March 17th, 2009, 08:34 AM
I was thinking that I have to delete the ".svn" folder in every directory. Anyone want to give me a bash script that does this?

This should work. Run it from the root of your project.


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

shadow_code
March 17th, 2009, 01:07 PM
An easier way might be to simply "svn export" that path to another location.

spupy
March 17th, 2009, 01:50 PM
Say you want to remove a folder named lalala.


svn export lalala /new/path/where/you/want/it
svn rm lalala

Then delete the folder lalala by hand and commit.

kerryhall
April 3rd, 2009, 02:32 AM
Thank you all, this was extremely helpful!