views:

2786

answers:

14

I have a folder that is my working copy. How do I remove all SVN functionality from this folder? There is a reason for me doing this, somehow my master folder that contains all my working copies of sites, has somehow been turned into a working copy itself, so I have a working copy within itself as such.

So, is there an easy way of removing version control from a folder?

+13  A: 

Just remove all ".svn" folders in it. That's it.

Gregor
"Export" is much easier
roman m
not if the remote repo has died, then export is impossible
DevelopingChris
+4  A: 

You can either manually delete all of the .svn folders (make sure to do this for every subfolder as well) or use a simple utility like Jon Gallaway's shell command.

Ben Hoffstein
Sweet. Gonna add this to my machine.
Marc Reside
+1  A: 

can't you just delete the .svn subfolder?

As far as I know SVN stores everything about its connection to the repository in this subfolder (at least in windows)

Sam
+22  A: 

svn export is the command you're looking for. You can export a controlled set of files to a non-controlled location and use that.

Robert Elwell
Scott Kramer
For my money this is what I wanted to do...
leeand00
+1  A: 

With TortoiseSVN, you can do a right-clic drag & drop your folder and then choose a "SVN Export All to here" command.

Michel
+1  A: 

TortoiseSVN has the ability to Export files without its subversion bindings - right click on a repository (or a directory within a repos), then TortoiseSVN, then Export. Another way to do it is to remove all the .svn directories in all the folders.

pzycoman
+2  A: 

Windows client "TortoiseSVN" has "Export" feature. Export creates a copy elsewhere in a different folder without all those ".svn" folders in them. You can export either from repository or from local copy with option to include unversioned files.

Marko Dumic
+7  A: 

If you're using TortoiseSVN you can just right click within the root folder of your working copy and click Export... That will work even if you have uncommited changes.

Likewise, you can just do an Export from your repository, and it won't create any of the .svn folders.

Another straightforward approach is to just delete all .svn folders as previously mentioned.

Esteban Brenes
+1  A: 

As others have said, deleting the .svn folder will remove SVN functionality from that folder. If you do it recursively, you will "un-SVN" your entire WC, which is essentially what the export command does. I'm not sure if it's a feature of Tortoise, the CLI SVN binary, or both, but I recall that one of them allows you to do an in-place export which literally just removes the .svn folders from a WC. A normal export creates a copy of your WC at a new location that is unversioned.

rmeador
+2  A: 

how about this:

for /f "tokens=* delims=" %%i in ('dir /s /b /a:d ".svn"') do rd /s /q "%%i"

to recursively remove all the .svn folders--

(if the export function isn't an option for you--, can't access repository etc...)

Scott Kramer
upmod for gratuitous use of DOS :-)
endian
Careful -- that will remove any directory whose name ends in "svn".
j_random_hacker
fixed, thank you
Scott Kramer
+16  A: 

Straight from the horse's mouth.

Milen A. Radev
RTFM lol, thanks.
Pickledegg
So you export a folder to itself. Is this an SVN feature, or only a tortoise SVN feature?
Casebash
AFAICT it's a TSVN feature (and that's what the linked article says also: "TortoiseSVN has a little known feature...").
Milen A. Radev
+4  A: 

If you were using *nix-like tools:

find . -type d -name .svn | xargs rm -fr
Andy Lester
Please use `find . -type d -name .svn -print0 | xargs -0 rm -fr` instead to avoid all hell breaking loose when filenames contain spaces.
j_random_hacker
+1  A: 

Here is a Windows batch script that will delete all .svn folders from a Subversion working copy directory:

@echo off
rem cleanup .svn subdirs

setlocal enabledelayedexpansion

rem change to directory that this batch script resides in

if "%~1"=="" (
    echo Usage: svncleanup svn_working_copy_dir
    exit /b 1
)

echo cleaning up .svn subdirs in "%~1" ...

for /R "%~1" %%I in (.svn) do rmdir /Q /S "%%I" > NUL 2>&1
sakra
+1, this will only remove .svn folders and nothing else.
j_random_hacker
A: 

I just use Windows Explorer to search for ".svn" (starting at the top of my working copy) and then I select all the folders it finds and delete them.

Mike