SVN从中继切换到分支 [英] Svn switch from trunk to branch

查看:118
本文介绍了SVN从中继切换到分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我位于SVN托管项目的 trunk 的根文件夹中,并且正在探索建立两个分支机构。

I am in the root folder of an SVN-hosted project's trunk and am exploring setting up two branches.

在当前(稳定)版本中,一个分支将是该项目的快照,第二个分支将是我将应用一些新的分支编码,测试,然后将中继升级到新版本。

One branch will be a "snapshot" of the project at the current (stable) revision, and a second branch will be one I'll work on to apply some new code, test, and then upgrade the trunk to a new version.

我的目标是将快照保留为保险,并且是获取项目的较旧且稳定版本的快速方法。一旦应用了新鲜的代码并通过了测试,第二个分支将被合并回我们提供给公众的主干中。

My goal is to keep the snapshot as insurance and a quick way to get an older, stable version of our project. The second branch, once we apply fresh code and the tests pass, will be merged back into the trunk, which we offer to the public.

要设置快照,我将 trunk 复制到了一个名为 v1p2p3 的分支中:

To set up the snapshot, I copied our trunk to a branch called v1p2p3:

$ svn cp https://www.example.com/svn/trunk \ 
         https://www.example.com/svn/branches/v1p2p3 \
         -m "Branching from root trunk to v1p2p3 at r1114"

到目前为止,很好:

Committed revision 1115.

我想做的是将本地存储库副本切换到此分支,以确保一切正常,但是我收到一条错误消息:

What I would like to do is switch my local repository copy to this branch, to make sure that things worked, but I get an error message:

$ svn switch --relocate https://www.example.com/svn/trunk \
                        https://www.example.com/svn/branches/v1p2p3

错误消息是:

svn: E155024: Invalid relocation destination: 
              'https://www.example.com/svn/branches/v1p2p3' 
              (does not point to target)

我在做什么错了?

(如果这不起作用,我怀疑我无法从更具雄心的第二分支开始。我正在寻找一种不会破坏现有项目布局的方法。感谢您的建议,如果这是一个愚蠢的问题,我们深表歉意。)

(If this doesn't work, I suspect I can't get to starting on the more ambitious second branch. I'm looking for a way to do this that won't damage the existing project layout. Thanks for your advice, and apologies if this is a dumb question.)

推荐答案

您不需要-relocate ,因为分支位于同一存储库URL中。只需这样做:

You don't need to --relocate since the branch is within the same repository URL. Just do:

svn switch https://www.example.com/svn/branches/v1p2p3

这篇关于SVN从中继切换到分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆