tags:

views:

1598

answers:

11

If I want to take a folder that was under subversion and remove any link to subversion at all, do I just delete the .svn folders and that's it? Anything else I have to consider?

+1  A: 

Yes. Just delete .svn folder and your folder will no longer be under the control of subversion.

The .svn folder is the pristine copy of your repository when you did the checkout. So, it acts as the link between your server and your working copy. Once you delete it, you lose this "link".

Edit:

If you have any subfolder in your project, you will have a .svn folder in each of them. So, if you want to remove the link to subversion, you need to delete these .svn subfolders.

Francis B.
did that. Looks alright except my Resharper Folders still have a ? on them because I never checked them into SVN. But why would they have a ? in them if I deleted all .svn folders...something else is tying my main folder here to SVN still that's telling me that these Resharper folders are not in version control. Why is that?
CoffeeAddict
I dont have resharper so I can't tell you why you have this issue. But I can tell you that once I delete .svn folder, VisualSVN in Visual Studio does not display status icon anymore.
Francis B.
Yea, I don't have any status icons except that ? which is a Subversion icon because I never checked in those Resharper folders. After deleting all .svn folders I don't get why I am even getting the ? overlay still on those Resharper folders
CoffeeAddict
@coffeeaddict: You may be running into TortoiseSVN cache issues if you are still seeing icons. Rebooting or killing the TSVNCache process should clear it up.
Travis Beale
A: 

Nope, deleting the .svn directories will remove any "connection" to the repository.

mipadi
Okay, I don't usually complain about downvotes, but why the downvote to this answer? It isn't _wrong_ (or if it is, the downvoter should specify _why_ it's wrong).
mipadi
+1  A: 

Yes.

Though an easier way is probably to just export that folder.

Assaf Lavie
+7  A: 

No, you just have to search for all .svn folders and delete them. Alternatively, doing a svn export allows you to get the folder without the svn folders.

Valentin Rocher
Only tortoiseSVN will keep your local modifications. Standard SVN export will give you the version from your repository. So you will lose all your local modifications.
Peter Parker
I am using Tortoise. I want version history, everything removed as if my folder was never hooked/linked to SVN in the first place
CoffeeAddict
It is good idea to add shell command "Delete from SVN" as described in this blog post http://bit.ly/CDlG. Of course only if you are using windows.
zidane
check this link contain script to remove .svn flder http://cocoabugs.blogspot.com/2010/09/script-to-remove-hidden-svn-folder.html
jeeva
+3  A: 

Normally yes, removing .svn folders is enough, but define "remove any link to subversion at all". Because there are such features as keyword substitution inside the versioned files.

Laurynas Biveinis
Good point. Also, removing just the .svn (or _svn) directories only tells your Subversion CLIENT (i.e. TortoiseSVN) not to track these files. They of course still exist on the Subversion server.
tyriker
I am cleaning out my folder that contains my .NET solution and project to have no ties to SVN any longer whatsoever.
CoffeeAddict
what do you mean by versioned files. Once I delete all .svn folders isn't there no more links to SVN?
CoffeeAddict
It is possible to have comments in a file such as "$Revision: 123$" "$Author: Somebody$" whose text is automatically inserted by SVN server and which one could call "a link to SVN"
Laurynas Biveinis
I just wanted to know if there are any files physically here that I need to delete other than the .svn folder. Are there any other svn related files that live outside an .svn folder period that svn creates?
CoffeeAddict
Ah, OK. Nope, then you delete .svn folders and that's it.
Laurynas Biveinis
Yes. That's the beauty of SVN: everything related to SVN is defined in each folders own .svn folder. That is also the reason that nothing can be defined to be valid recursively. For example, you cannot define an ignore filter that also applies for all sub folders automatically, which is something I would like to have. The only alternative is to set it in the global options where you can define ignore filter that applies everywhere.
awe
+1  A: 

Please correct me if I'm wrong, but doesn't svn export do this?

Mike
+1  A: 

You can manually delete all .svn folders.

Alternatively, you can use svn export to export a clean directory tree. Keep in mind though that it will not export files that are not under version control.

The advantage of using svn export is that you can get a pristine copy and keep your original repository in a single command.

Karl Voigtland
A: 

I like to use deletesvn.reg. It adds a "Delete SVN Folders" to your context-menu in Explorer. Selecting it recursively deletes .svn folders, thus disconnecting your folders from SVN. The problem I've had with SVN Export, as others mentioned, is that it only exports files that are in the repo, ignoring all those hidden files you might need.

DavGarcia
+1  A: 

On unix systems over the shell:

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

On Windows:

  • Execute a search on the folder for ".svn", select all and delete them
Juri
Add -depth, or find will try to recurse into the .svn directory it just deleted, resulting in an error message.
DevSolar
Thx for the hint. But I never got such error messages.
Juri
+2  A: 

Found the following windows command-line here:

FOR /F "tokens=*" %G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%G"

It works for me. (If you want to use this in a batch file, put "%%G" instead of "%G")

+3  A: 

When using TortoiseSVN, right-mouse drag a folder that is under version control to a destination, and select "SVN Export all items here" from the context menu.

This will create a folder with your working folder, without the .svn files.

Zurb