我可以从 Eclipse 切换 SVN 存储库吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/679585/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can I switch SVN repositories from Eclipse?
提问by Brandon Yarbrough
I am moving my Subversion repository from one machine to another. I have a few scattered working copies on various machines, and I have found that I can easily switch the working copies from the old server to the new one with the following command:
我正在将我的 Subversion 存储库从一台机器移动到另一台机器。我在各种机器上有一些分散的工作副本,我发现我可以使用以下命令轻松地将工作副本从旧服务器切换到新服务器:
svn --relocate svn://oldServer/repo svn://newServer/repo
However, on one of my machines, I use Eclipse with Subclipse, and I don't like to use command-line SVN on my Eclipse projects. My question is whether it is possible to switch SVN repositories from within Eclipse using either Subclipse or Subversive.
但是,在我的一台机器上,我将 Eclipse 与 Subclipse 一起使用,并且我不喜欢在我的 Eclipse 项目中使用命令行 SVN。我的问题是是否可以使用 Subclipse 或 Subversive 从 Eclipse 中切换 SVN 存储库。
回答by Luke
I think you need to go into your 'repository browser' perspective there you right click your current repository and 'relocate' it to another domain.
我认为您需要进入“存储库浏览器”视角,然后右键单击当前存储库并将其“重新定位”到另一个域。
回答by Stefan Haberl
Do not use the "Team/switch" option, but rather change to the "SVN repository exploring" perspective and change the URL location there in the location properties of your repository. Works like a charm on Indigo - using Subversive in my case.
不要使用“团队/切换”选项,而是更改为“SVN 存储库探索”透视图并在存储库的位置属性中更改 URL 位置。就像 Indigo 上的魅力一样 - 在我的情况下使用 Subversive。
When using Subversive this will show a warning "The attached projects will be relocated because the repository root URL differs from the previously entered one", which is just what you want. Be sure to open all projects you want relocated before doing this.
使用 Subversive 时,这将显示警告“附加的项目将被重新定位,因为存储库根 URL 与之前输入的 URL 不同”,这正是您想要的。在执行此操作之前,请务必打开要重新定位的所有项目。
When getting "Cannot relocate the connected projects"with "Relocation cannot be performed because the new URL refers to the different repository"then maybe your repository root has no trunk/tags/branches folders, or has such folders in subfolders as well. Then on the tabsheet Advanced, disabling the option Enable Structure Detection might help.
当收到“无法重新定位连接的项目”和“无法执行重新定位,因为新 URL 指代不同的存储库”时,那么您的存储库根目录可能没有主干/标签/分支文件夹,或者在子文件夹中也有这样的文件夹。然后在选项卡高级,禁用选项启用结构检测可能会有所帮助。
If you get "Relocation cannot be performed because the new URL refers to the repository which is not valid (incorrect URL or credentials specified)"then also make sure the root path within the new repository URL matches the root of the old URL. (In other words: ensure that /new/path
in the screenshot above has the same subfolders as the old URL.)
如果您收到“无法执行重定位,因为新 URL 引用的存储库无效(指定的 URL 或凭据不正确)”,那么还要确保新存储库 URL 中的根路径与旧 URL 的根匹配。(换句话说:确保/new/path
在上面的屏幕截图中具有与旧 URL 相同的子文件夹。)
回答by gerardcl
Just right click on the project-> team -> disconnect.
只需右键单击项目-> 团队-> 断开连接。
Then another right click on the project -> team -> share -> to your new SVN.
然后再次右键单击项目-> 团队-> 共享-> 到您的新SVN。
That's it!
就是这样!
回答by stan riley
Within Eclipse Navigator, if you right-click the project name a submenu will appear. On that sub-menu select Team which will provide some addtional menu options. Select the "Swich to another Branch/Tag/Revision ..." and a window will appear allowing you to specify the new branch or in your case a new repository location.
在 Eclipse Navigator 中,如果右键单击项目名称,将出现一个子菜单。在该子菜单上选择 Team,它将提供一些附加菜单选项。选择“Swich to another Branch/Tag/Revision ...”,将出现一个窗口,允许您指定新分支或在您的情况下指定新存储库位置。
回答by Nicolas Finelli
You can do the following:
您可以执行以下操作:
Go to project explorer view -> right click on your project -> team -> switch ... and now select the new URL.
转到项目资源管理器视图 -> 右键单击您的项目 -> 团队 -> 切换 ...,现在选择新 URL。
Thats all!
就这样!
回答by boumbh
I could not relocate from my eclipse. I have different projects on different branches and tags (read-only it's only for comparing different versions) of the same repository. When the ip of our svn server changed, I could relocate through TortoiseSVN but not from Subclipse.
我无法从我的日食中重新定位。我在同一个存储库的不同分支和标签(只读,仅用于比较不同版本)上有不同的项目。当我们的 svn 服务器的 ip 更改时,我可以通过 TortoiseSVN 重新定位,但不能从 Subclipse 重新定位。
Changing from http://oldserver/svn/PROJECTNAME
to http://newserver/svn/PROJECTNAME
I get :
更改http://oldserver/svn/PROJECTNAME
为http://newserver/svn/PROJECTNAME
我得到:
org.apache.subversion.javahl.CientException: Invalid operation on the current working directory
svn: Cannot relocate 'E:\…\workspaces\PROJECTNAME\tags\modulename.4.007\base' as it is not the root of a working copy; try relocating 'E:\…\workspaces\PROJECTNAME\tags\modulename.4.007' instead
Ok but I don't have the control over this. I ended with a workaround involving my hosts file.
好的,但我没有控制权。我以涉及我的主机文件的解决方法结束。
回答by Saqib Ahmed
In Eclipse, go to Window -> Perspective -> Open Perspective -> Other -> SVN Repository Exploring. Click Ok
在 Eclipse 中,转到 Window -> Perspective -> Open Perspective -> Other -> SVN Repository Exploring。单击确定
Then right click on the repository you want to change -> Location Properties.
然后右键单击要更改的存储库 -> 位置属性。
Change the url click finish.
更改网址点击完成。
That's it!
就是这样!
回答by マイクル チョイ
team -> disconnect
团队 -> 断开连接
and
和
team -> share -> to your new SVN
团队 -> 分享 -> 到你的新 SVN
This is better solution than switch.
这是比 switch 更好的解决方案。
回答by Robin Green
You may be able to just swap the server names in DNS; this might be easier than switching all the working copies.
您也许可以在 DNS 中交换服务器名称;这可能比切换所有工作副本更容易。