问题
We have a very complex SVN tree at my employer that has several project trees contained within the same repository, as follows (each leaf in this diagram has a complete trunk/branches/tags structure in it, btw)
svn.contoso.com/root_repository_path/
|- project1
|- project2
| |- subprojectA
| |- subprojectB
|- project3
|- project4
|- |- subprojectA
|- |- subprojectB
|- project5 (the project I'm on)
This works fine so far. However, a fellow developer did a bit of reorganizing, and moved project5 (the project I am working on) up under project4 (which is a folder containing several related projects). How do I migrate my working copies to use the new path? Do I need to relocate, switch, both, or do something else? (Note that I have uncommitted changes in at least one of them, so checking out a fresh WC is something I want to avoid if at all possible.)
回答1:
First, I'd make a manual copy of your working copy before doing anything just to make sure that you don't lose the changes in your working copy.
Since the project was moved within the same repository, you'd want to use svn switch
.
Use svn switch
when updating your working copy to another URL in the same repository (i.e. switching to another branch).
http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.switch.html
Use svn relocate
when updating your working copy to another URL in a different repository.
http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.relocate.html
来源:https://stackoverflow.com/questions/27844340/svn-switch-vs-relocate-in-a-multiple-project-repository-case