如何重命名 SVN 分支并更新现有沙箱中的引用?
我需要重命名一个 SVN 分支,所以我这样做了:
$ svn move https://server/repos/myrepo/branches/oldbranch \ https://server/repos/myrepo/branches/newbranch
到目前为止,一切顺利——分支已被重命名。
问题是,我们从这个分支中签出了现有的沙箱,当我尝试更新时,我收到此错误:
$ svn update svn: Target path '/branches/oldbranch' does not exist
一个相当不言自明的错误。经过快速搜索,我想我已经找到了解决方案:在分支重命名后重新定位 SVN 工作副本
问题是,当我尝试发出该命令,我收到另一个错误:
$ svn switch --relocate https://server/repos/myrepo/branches/oldbranch \ https://server/repos/myrepo/branches/newbranch svn: Relocate can only change the repository part of an URL
据我所知,我使用 --relocate
命令的方式与 Sander Rijken 相同。有什么想法为什么我会收到此错误吗?
I needed to rename a SVN branch, so I did:
$ svn move https://server/repos/myrepo/branches/oldbranch \ https://server/repos/myrepo/branches/newbranch
So far, so good -- the branch has been renamed.
The trouble is, we have existing sandboxes checked out from this branch and when I try to update I get this error:
$ svn update svn: Target path '/branches/oldbranch' does not exist
A fairly self-explanatory error. After a quick search I thought I had found the solution: Relocating SVN working copy following branch rename
The trouble is, that when I try to issue that command I get another error:
$ svn switch --relocate https://server/repos/myrepo/branches/oldbranch \ https://server/repos/myrepo/branches/newbranch svn: Relocate can only change the repository part of an URL
As far as I can see, I am using the --relocate
command the same way as Sander Rijken. Any ideas why I get this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
执行即可。
只需在您的工作副本中
Just do
from within your working copy.
要更改相对路径,您必须使用pure
svn switch
(无论如何switch --relocate
已被弃用),如第一种形式的svn help switch
中所写即在
oldbranch
的 WC 根目录中,现在是newbranch
,您必须使用svn switch ^/branches/newbranch
For changing relative path you must to use pure
svn switch
(and anywayswitch --relocate
is deprecated), as written insvn help switch
for 1-st formI.e in the root of WC for
oldbranch
, which is nownewbranch
, you have to usesvn switch ^/branches/newbranch
如果您只是想在 Eclipse 中重命名 SVN 分支,最简单的方法就是进入 SVN Repository Exploring Perspective,然后右键单击您的分支 -> 。重构->重命名
If you had simply wanted to rename a SVN branch in Eclipse, the easiest would have been to go into the SVN Repository Exploring Perspective, and then right click on your branch -> Refactor-> Rename