TortoiseSVN Logo

Unversion a working copy

A lot of people asked on our mailing lists how they can "unversion a working copy", "detach/unlink a working copy from the repository", "remove files from version control" or something like that. All those questions lead to the users wanting to remove the hidden .svn folders inside every Subversion working copy.

Usually, you want a "clean copy" of your versioned files for zipping, archiving, ...
The command in Subversion to do that is "Export". Exporting a working copy or a repository url will create a copy of all your files, but without those .svn folders. But the export command creates a copy, it does not remove the .svn folders from an existing working copy. Which is what most users want.

But some users really want to just make a working copy unversioned. Searching the web you can find a lot of users posting scripts which scan a path recursively and delete all those .svn folders. But if you have TortoiseSVN installed, that isn't needed:

TortoiseSVN has a little known feature built in which can do exactly that: it removes all .svn folders automatically. So where can you find that feature?
Use the "Export" command! But hey, didn't I just tell you that the export command creates a copy of the files in your working copy and doesn't change your original working copy? So how can the export command remove the .svn folders from an existing working copy?
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.

Another way to do this is by right-dragging the working copy onto itself. The Explorer doesn't allow dragging items onto themselves in the same window though, so you must either use a second Explorer window or drag onto the tree view as shown in the animation below: