14

On my server I have subversion installed, but I accidently removed the .svn folder from the root so the folder is no more under version control.

When i try to make a new checkout, I get an error

svn: 'repo' is already a working copy for a different URL

Thats probably because .svn is still available in sub-folders.

How can I get back the .svn folder so that I have subversion available?

Cédric Julien
  • 78,516
  • 15
  • 127
  • 132
Nenad
  • 3,438
  • 3
  • 28
  • 36
  • Is it a local server or remote. In some cases you can do Ctrl+Z and it will reproduce the files deleted by mistake. Basically this is an UNDO shortcut. – TheTechGuy Nov 07 '11 at 19:00
  • Unless you have uncommitted changes, just delete the folder altogether and do a clean checkout. If you have uncommitted changes, checkout to a different folder, then merge. – driis Nov 07 '11 at 19:01
  • +1. Good question. I did the same thing last week and ended up deleting EVERYTHING and doing a fresh checkout. I'd also like to know a less ridiculous way of correcting such a mistake. – David Nov 07 '11 at 19:02

2 Answers2

13

try to checkout your repo in a fresh folder, then copy the root .svn directory into your old root folder, it should do the stuff.

Cédric Julien
  • 78,516
  • 15
  • 127
  • 132
1

You could delete everything and checkout a fresh copy. Or you could try letting everything in place and checkout with a depth of 1. See http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.checkout.html

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255