SVN - Change working copy to point at new svn path

94,172

Solution 1

svn switch --relocate is deprecated as of version 1.7 of subversion. Use the svn relocate command instead.

It takes either FROM-PREFIX TO-PREFIX [PATH...] or TO-URL as arguments.

See

svn help relocate

for more information.

Solution 2

Use the svn switch command with the --relocate command line option.

Solution 3

Using TortoiseSVN

  1. Right click on working copy and select 'SVN Switch...'
  2. On 'Switch to branch' form Select new SVN path

Using Command

  1. Open console
  2. Navigate to the working copy cd [working copy path]
  3. Write the command svn relocate [new url]

Solution 4

To be more precise

svn switch --relocate [complete url of the old repo] [complete url of the new repo] 

For example:

svn switch --relocate  http://svn.repo.com:9880/website/branches  http://svnrepo.com/web/branches 

Solution 5

Using TortoiseSVN tortoisesvn docs

  1. Go to the working copy's root folder
  2. Right Click, Click TortoiseSVN Submenu, Click Relocate.
  3. Enter the new path
Share:
94,172
quano
Author by

quano

Updated on February 03, 2020

Comments

  • quano
    quano over 4 years

    I've got a SVN Repository that has moved to a new address/path. However, I've got a working copy with uncommitted source code still pointing to the old (now invalid) repository path. How do you change a working copy to point at a new repository?

  • quano
    quano over 14 years
    Thanks. This is what I used: svn switch --relocate file:///Users/user/old_repository/project/trunk file:///Users/user/new_repository/project/trunk
  • zck
    zck over 10 years
    This is applicable only if using TortoiseSVN, which the poster didn't indicate he or she is using.
  • Ahmed Abdallah
    Ahmed Abdallah over 10 years
    Hi @zck please note that I wrote 2 solution in 1 answer first TortoiseSVN and the second is Command this command is deprecated for subversion in general you can review this page svn relocate/svn Subcommands
  • zck
    zck over 10 years
    Well, your answer was edited after I commented to include a commandline way of doing it. That commandline answer was already posted in June, so there's no need to repeat it.
  • Ahmed Abdallah
    Ahmed Abdallah over 10 years
    No, I post the answer in its current words my edit just for improve formatting; and I think the command I wrote is more clear than the one was wrote in June
  • Spear
    Spear about 7 years
    Does not fix the URLs in svn:externals. Any idea how to do that ?
  • Gerard ONeill
    Gerard ONeill over 4 years
    The TortoiseSVN GUI way requires a click on 'relocate', and not switch. Which makes sense given the command line.. Not sure what switch would do -- it seemed to be trying to access the old URL and the new URL, something I didn't want it to do.