将工作副本更改为指向新的 SVN 路径

我得到了一个 SVN 知识库,它已经移动到了一个新的地址/路径。但是,我有一个工作副本,其中未提交的源代码仍然指向旧的(现在无效的)存储库路径。如何更改工作副本以指向新的存储库?

96830 次浏览

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

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.

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]

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

Very Simple :

Step 1: Open command prompt / terminal and set workpath

Step 2: Execute this line svn switch --relocate http://newurl

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

I had changed my svn server to force redirect everything from HTTP to HTTPS (and it could have been a redirect to any other URL), and I noticed that this svn relocate command was causing lots of problems with externals. Fortunately I found that the easiest thing was to just do an svn update and due to the redirect of the svn server, it updated all the URLs store in the local working copy, including the externals.