SVN - Change working copy to point at new svn path
SvnPathWorking CopySvn Problem Overview
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?
Svn Solutions
Solution 1 - Svn
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 - Svn
Use the svn switch
command with the --relocate
command line option.
Solution 3 - Svn
Using TortoiseSVN
- Right click on working copy and select 'SVN Switch...'
- On 'Switch to branch' form Select new SVN path
Using Command
- Open console
- Navigate to the working copy
cd [working copy path]
- Write the command
svn relocate [new url]
Solution 4 - Svn
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 - Svn
Using TortoiseSVN tortoisesvn docs
- Go to the working copy's root folder
- Right Click, Click TortoiseSVN Submenu, Click Relocate.
- Enter the new path
Solution 6 - Svn
Very Simple :
Step 1: Open command prompt / terminal and set workpath
Step 2: Execute this line svn switch --relocate http://newurl
Solution 7 - Svn
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.