views:

5243

answers:

7

This is a stupid question but I can't figure it out (I'll blame it on post-superbowl Monday syndrome) but how do I remove a folder from being source controlled with TortoiseSVN?

+4  A: 

You right click on the directory, go to TortoiseSVN -> Delete. You then right click on the parent directory and SVN Commit... and that will remove the folder.

Sean Bright
This will delete the folder as well.
tunnuz
That is correct.
Sean Bright
+5  A: 

The TortoiseSVN menu has an Export option which will give you a copy of the folder detached from the repository. Alternatively, you can right-click + drag a folder and pick either "SVN Export to here" or "SVN Export all to here".

"Export all" is equivalent to selecting "Export unversioned files too" in the Export dialog, which will effectively clone the working copy without the .svn folders.

dahlbyk
+8  A: 

If you want to remove the folder from source control but keep it locally, the easiest way would be to

  1. create a backup of the folder (just copy it somewhere else)
  2. follow the instructions for deleting it
  3. restore the folder
  4. tell subversion to "Ignore" the folder

You should also delete the .svn directory that's kicking around in the folder that you're removing or you'll end up confusing svn/tortoise. You can also do an "Export" for step 1 which will remove any .svn directories for you (if you're doing this for a whole directory tree rather than a single directory, this is a lot more convenient than cleaning the folders out by hand).

John Price
For (1) you can Export to get rid of the copy's SVN data.
dahlbyk
Right - you have to delete it through TortoiseSVN, restore it, and then delete all of the svn folders within it (as well as the .version) file.
Chance
* and then ignore it - it worked like a charm though (thanks)
Chance
@dahlbyk good point
John Price
+10  A: 

The easiest way is described here: http://tortoisesvn.net/node/343

That article is a bit wordy and some of the methods didn't work for me (like dragging the folder onto itself - Windows 7 wouldn't allow it)).

Here's what, in the article worked for me:

Simple: when you right-click on a working copy and choose "Export..." from the context menu, a folder browse dialog is shown where you can choose the folder where you want the working copy exported to. If you now select the very same path that your working copy is on as the target (i.e., you're exporting the working copy onto itself), TortoiseSVN will remove all .svn folders of that working copy.

Stefan
+1. This is undoubtedly the easiest way. Thank you.
Jim Schubert
Stefan, I tried the procedure you described and TSVN shows me the "Unversion" dialog (with a progress bar showing progress), but after completing the process, the folder is the same as before. I have Win7 and the folder is on a network share - could this have something to do with the procedure failing (silently)?(+1 anyway, because this procedure is exactly what I need)
Heinrich Ulbricht
It shouldn't fail silently. Are you sure that the hidden .svn folders are still there?
Stefan
Yep, I can see them. My original problem is that I want to get rid of a whole checked out directory (including subdirs) on the network share. This failed because windows says, somebody is using the files. So I thought, it might be the svn cache and that by using a method from the TSVN-world I could solve this access problem. But no luck :(
Heinrich Ulbricht
To prevent the need to follow a link, the procedure is repeated here: Simple: when you right-click on a working copy and choose "Export..." from the context menu, a folder browse dialog is shown where you can choose the folder where you want the working copy exported to. If you now select the very same path that your working copy is on as the target (i.e., you're exporting the working copy onto itself), TortoiseSVN will remove all .svn folders of that working copy.
rathkopf
When I tried this I then starting getting errors that the directory I had Exported to itself was now "not a working directory" and it was "obstructed" and I should Cleanup, but when I tried that (IIRC) I got an error that the root directory was locked.I finally just did a MOVE (Drag the folder to a non SVN folder and from the drop-down menu choose "Export ...") and then a Delete (both with Tortoise).
Clay Nichols
+1  A: 

Windows Search, set system and hidden files flag... filename ".svn" ... after it searches - sort so all .svn directories are grouped together... highlight - hit delete :)

Jason P Sage
+1  A: 

To remove the item from source control but keep the file locally there is a dedicated item in the extended context menu:

  • Hold the Shift key down and right click on the folder.
  • Under the TortoiseSVN menu click on "Delete (keep local)"

TortoiseSVN's extended context menu.
Delete (keep local) documentation blurb.

bob esponja
+1  A: 

This is what worked for me:

1) Right click on the folder/branch that you want to delete and use TortoiseSNV->Delete 2) then perform a cleanup. I did this from the commandline svn cleanup ; otherwise you can do the same right click on the folder and perform a cleanup. 3) Go to the parent directory of the folder you want to delete and commit the changes.

this should remove the folder from your working directory and from svn.

zen