How to switch subversion repository in Visual Studio using AnkhSVN?

早过忘川 提交于 2019-11-30 13:15:50

问题


I've been developing a project locally and using a local svn server for versioning in visual studio. I now want to switch to xp-dev hosted versioning but cannot seem to get rid of the svn bindings on my solution? Is there an easy way to duplicate a solution without its versioning settings or to simply switch to the other svn (which is completely empty)?


回答1:


Edit: Note that this assumes that you are trying to move to a new repository, dropping all your history, not move a repository. Thinking about it you might want to replace the removing all .svn folders with simply exporting the folder into the newly created workspace for the new repo.

Not that I know of. I'd probably do this,

  • Remove all the .svn folders from your solution
  • Create a folder for the solution in the new repo,
  • Check it out,
  • Move your current solution into that folder,
  • Load up the solution in Visual Studio
  • Use AnkhSvn to add it again. It should pick up the fact that it's in a subversioned directory and allow you to do that.



回答2:


There's a switch/relocate built-in:

  • Open View -> Pending Changes
  • Click the dropdown that shows the current repository url, or the button to the right of that
  • Enter / browse to the new location
  • A dialog comes up wether you want to relocate (because switching isn't enough here)



回答3:


Also you can right click on solution or project and on the Subversion menu the option "switch project" is available

subversion server name change with ankhsvn




回答4:


Other way is to edit wc.db (SQLite file) in your ".svn" folder, which contains repository URL. I used Firefox addon SQLITE editor, then in table REPOSITORY is only 1 row saying your repository URL, change it to new host and there you go.

My case was that I have new computer with new HOST, so all my projects added to SVN repository had and old URL (old hostname).




回答5:


Try going to File > Subversion > Change Source Control... and changing the SCC Binding URL.

EDIT: I see that's not editable. You may need to drop to the command line for this.

In your base directory, issue this svn command:

svn switch --relocate http://old.repo.location http://new.repo.location

with your speific URLs, of course. I'd recommend reading up on the switch command so you're sure of what you're doing. When you reopen VS, AnkhSVN should pick up the new bindings. If you've added the solution through the File > Subversion menu, you may need to edit the .sln file. Just open it in a text editor and change all of your old repository URLs to the new URL.

You could also install TortoiseSVN and use the context menu to issue the Relocate command. This will be the easiest.

Back up your directory before any of these changes, of course.




回答6:


I "exported" from SVN, then did an "Add Folder" to the new repo in the SVN Repo Browser, then opened the .sln in Visual Studio.




回答7:


In my case I had to change the URL of the SVN because the DNS didn't know about the hostname so I had to use the IP address.

You can edit your hosts file located under: C:\Windows\System32\drivers\etc

And simply enter a line like

xxx.xxx.xxx.xxx     hostname


来源:https://stackoverflow.com/questions/2276952/how-to-switch-subversion-repository-in-visual-studio-using-ankhsvn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!