9

Is there a way to alter the branch to which a working copy relates?

Another developer has renamed the branch im wokring on, so I cant commit any work any more.

Could I just edit all the .svn directory files to point to the new location?

pauljwilliams
  • 19,079
  • 3
  • 51
  • 79

2 Answers2

5

You almost answered it yourself, you can do this by relocating:

svn switch --relocate FROM TO

for example

svn switch --relocate http://server/svn/repos/branches/foo \
    http://server/svn/repos/branches/bar
Sander Rijken
  • 21,376
  • 3
  • 61
  • 85
  • 2
    I am getting this error "svn: Relocate can only change the repository part of an URL" when issuing this command. See here: http://stackoverflow.com/questions/5102758/how-to-renaming-a-svn-branch-and-update-references-in-an-existing-sandbox – Lee Netherton Feb 24 '11 at 09:35
  • 4
    I don't think this answer is correct. I believe a simple "svn switch" should do the job if only the name of the branch changed. "svn switch --relocate" is only usefull if the IP-address, hostname, or protocol has changed. Relocating is something that normally should happen only very infrequently. – Otherside Feb 24 '11 at 09:43
4

From the working copy directory:

svn switch http://server/svn/branches/newbranch
Alastair
  • 1,710
  • 2
  • 17
  • 33