135

How do I remove a folder from being source controlled with TortoiseSVN?

5
  • 11
    Good question. This is ludicrously complicated for what should be a simple task.
    – Paul Suart
    Commented Oct 26, 2010 at 16:10
  • A note for anyone who used "SVN Update to revision" (rather than svn checkout): try using SVN Update to revision again but this time with the Update Depth set to Exclude. Commented Oct 7, 2015 at 15:27
  • you can delete .svn related folder Commented Dec 26, 2015 at 9:04
  • I've always wondered if it is OK, on Windows / Tortoise, to very simply DELETE a local folder on the PC. So, there's a repo REPO on your server. And you happen to have a version of it on your PC, LOCALFOLDER. You just do not need that local version on that PC anymore. In this case I simply delete the folder LOCALFOLDER on the PC. (I do nothing, at all, from the Tortoise menu before throwing LOCALFOLDER in the trash.) To be clear I do not want to affect REPO in any way - I simply don't want/need the LOCALFOLDER version anymore. I've always wondered if it's OK to do this?
    – Fattie
    Commented Aug 23, 2016 at 11:42
  • Or, does Tortoise keep "something else" somewhere on the PC, so that from then on Tortoise will feel LOCALFOLDER is missing??
    – Fattie
    Commented Aug 23, 2016 at 11:43

13 Answers 13

180

The easiest way is described here: http://tortoisesvn.net/unversion.html

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.

6
  • 3
    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) Commented Feb 3, 2010 at 11:08
  • It shouldn't fail silently. Are you sure that the hidden .svn folders are still there?
    – Stefan
    Commented Feb 3, 2010 at 15:33
  • 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 :( Commented Feb 4, 2010 at 14:24
  • 1
    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. Commented Mar 3, 2010 at 19:14
  • 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). Commented May 25, 2010 at 3:18
62

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)"

enter image description here

Image cropped from TortoiseSVN's extended context menu page.
Delete (keep local) documentation blurb.

9
  • 4
    Actually that's CTRL + SHIFT when right-clicking the folder. Come-on Stackoverflow why did I find this answer at the bottom? Commented Apr 4, 2011 at 10:14
  • 5
    Which version are you guys using? Version 1.6.12 has no Delete (keep local) option. Neither Shift nor CTRL + Shift helps.
    – thehhv
    Commented Apr 5, 2011 at 12:41
  • 1
    I just checked again and just Shift+right click works for me. @thehhv version 1.6.10 still has the option. Commented May 14, 2011 at 22:01
  • 1
    Awesome answer. Shift + click does indeed work with 1.6.10. After doing this, you'll still have to commit the file to see it disappear from the remote repo.
    – hotshot309
    Commented Sep 3, 2013 at 19:47
  • 2
    This should be marked as the answer since it is the easiest way using TortoiseSVN
    – alejosoft
    Commented Aug 5, 2016 at 14:58
12

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).

4
  • 1
    For (1) you can Export to get rid of the copy's SVN data.
    – dahlbyk
    Commented Feb 2, 2009 at 16:20
  • 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
    Commented Feb 2, 2009 at 16:22
  • * and then ignore it - it worked like a charm though (thanks)
    – Chance
    Commented Feb 2, 2009 at 16:23
  • For me, just exporting it got rid of SVN repository and the green checkmarks on the folder, that I wanted.
    – TheTechGuy
    Commented Jul 26, 2011 at 19:24
7

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.

6

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.

2
3

Delete the .svn folder within the folder you want to remove from version control.

0
2

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

2

I ran the tortoise command "Update to SVN 1.7" which took all the .svn folders and combined them into a single folder. I was then able to delete just the one .svn folder and everything was good to go!

2

I see there are three simple methods to unverison and keep a local version of a file (or a directory) with TortoiseSVN:

  1. Exporting on the same path as Stefan wrote;
  2. "delete (Keep local)" function accessed with Shift key as bob esponja's answer;
  3. Unversion and add to ignore list option which I am reporting with this answer

I find the latter method the easiest of the three, while the first one (the most voted) the longest in terms of operations to perform.

1

This is what worked for me:

  1. Right click on the folder/branch that you want to delete and use TortoiseSNV->Delete
  2. Perform a cleanup. I did this from the commandline, svn cleanup <path to the folder to delete including folder name>; 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 Subversion.

1

Exporting the folder to a new location while "Export unversioned files to" option selected worked great for me. TortoiseSVN removes all the Subversion specific settings and you get a clean folder. Now you can delete the original one and move the new exported folder there.

0

Once in awhile I run into working copy folders from Subversion that I know longer want under version control. I want to “unversion” them. Usually I do some kind of find and delete on all the .svn related folders but there is an easier way if you have TortoiseSVN installed.

You should be familiar with the “Export” command. This will make a copy of the files in a new location without all those pesky .svn folders. If you want to ‘unversion’ something but don’t want a copy – simply do an “export” and when Tortoise asks for the “folder to export to” simply select the same folder your working copy is in! Tortoise will proceed to remove all the .svn folders.

Quote: http://thecrumb.com/2008/09/25/removing-svn-files-with-tortoisesvn/

-1

Right-click on a working copy and choose "Export..." from the context menu. A folder browse dialog is shown.

You must choose the same path that your working copy is on as the target. TortoiseSVN will ask you if you want to remove all .svn folders of that working copy. Just says yes!

Not the answer you're looking for? Browse other questions tagged or ask your own question.