18

I'm trying to svn checkout into my public_html folder, but I get this error: svn: '.' is already a working copy for a different URL

My brother already set up a boiler plate site for me, but I've changed it and put those changes into a repo of my own. How do I make this folder not be a working copy of the repo he set up originally?

Can I delete the public_html folder and make a new one? I'm fine with starting from scratch, as I'm going to just checkout an already installed drupal site onto this site.

I saw in another question that a solution may be to simply delete the .svn directory. I tried this, but it said permission denied for several subdirectories in .svn.

Thanks in advance for ANY help, hope this question isn't too dumb...

Zoe
  • 23,712
  • 16
  • 99
  • 132
  • 2
    If you don't have permission to delete public_html/.svn, then you won't be able to delete public_html either. – rodion Jun 01 '09 at 02:47
  • SVN from cmd line! you should totally use tortoise svn http://tortoisesvn.net/downloads –  Jun 01 '09 at 03:35

7 Answers7

10

You could try "svn switch". In the example at http:// svnbook.red-bean.com/en/1.0/ch04s05.html, it's as easy as:

 $ svn switch http:// svn.example.com/repos/calc/branches/my-calc-branch

But since you have subdirectory permissions issues, your plan to re-create public_html sounds like the best solution; just beware of typos with 'rm'. Try 'mv' to just move the old directory out of the way, which doesn't depend on subdirectory permissions.

You can use:

 $ mv public_html old_public_html
 $ mkdir public_html
 $ chmod 755 public_html
 $ cd public_html
 $ svn checkout url
krubo
  • 4,082
  • 3
  • 28
  • 40
6

This sequence of commands should do it if you're in a hurry.

There's gotta be a way to update the working copy's reference url, but I don't know it off-hand.

$ svn diff > ../changes.patch
$ rm -rf * ..?*
$ svn checkout url
$ patch -p < ../changes.patch
Joshua
  • 34,237
  • 6
  • 59
  • 120
  • This is (approximately) `svn switch`. Whoever ends up here from Google may want to check out https://stackoverflow.com/a/933468/2279059 – Florian Winter Apr 20 '20 at 11:50
1

I think that the best option in your case is to delete the folder and create it again doing the checkout from SVN

PabloCocko
  • 110
  • 1
  • 8
1

If you don't need a connection with your brother's repo, then just remove all his .svn dirs.

The permission issue is not related to SVN, definitely.

esycat
  • 1,204
  • 10
  • 10
0

I ran into this error ("... is already a working copy for a different URL") just now in Eclipse 3.5. I was trying to check out a particular branch of a project from the Eclipse "SVN Repository Exploring" perspective (the Subclipse subversion client adapter from tigris.org). I had drilled into [project] | branches | [branch] that I was interested in, then did right-click on the branch that I was interested in and selected Checkout; this led to the error.

For me, the fix was to instead go to the "Java EE" perspective, right-click on my project, and select Replace With | Branch/Tag... from the context menu. Doing this, I was successfully able download the branch I was interested in.

Jon Schneider
  • 21,628
  • 17
  • 129
  • 157
  • That "Replace With | Branch/Tag..." is probably Eclipses name for SVN SWITCH (see below). If any Eclipse/SVN guru could confirm this, it would make this thread clearer. (In my opinion the "switch" is exactly what is needed here, and it was designed for exactly this situation.) – johanekdahl Sep 24 '13 at 14:41
0

I've found that if I simply go to the J2EE perspective, right click on the project, and select Delete before I attempt to checkout a new branch, it solves this problem.

0

I saw in another question that a solution may be to simply delete the .svn directory. I tried this, but it said permission denied for several subdirectories in .svn.

Even when you can not delete directories you may move them away:

$ mv .svn /tmp/dustbin

edit:

You should have write access at least to your home directory:

$ mv ~/public_html /tmp/dustbin
$ mkdir ~/public_html
lispmachine
  • 4,117
  • 1
  • 20
  • 31