svn:用分支替换主干 [英] svn: replace trunk with branch

查看:61
本文介绍了svn:用分支替换主干的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使 subversion 存储库的分支之一成为新主干的最佳方法是什么?

整个系统发生了重大的改写:东西被移动、改写、替换、删除、重命名等.改写的代码已经过测试,准备替换旧的主干.

基本上,旧的主线(Trunk 5)被标记并且将在这里结束.重写后的分支(Branch 6)将成为新的主线(Trunk 7):

<前>中继(1) --> 中继(2) --> 中继(5) --> ×+--> 新树干(7)\ \ |叉合并???\ \ |+--> 分支(3) --> 分支(4) --> 分支(6) --+

来自旧主干"的所有正在进行的更改都已合并到重写分支"中

我该怎么做?

解决方案

使用 svn move 将旧主干的内容移动到其他地方,然后将分支重命名为主干.

请注意,svn 中的复制和移动与文件操作类似.您可以使用它们在您的存储库中移动/复制内容,并且这些更改也是版本化的.将移动"视为复制+删除".

Nilbus 刚刚通知我,当您使用 svn move 时,您会遇到合并冲突.

我仍然认为这是正确的方法.这会导致冲突,但如果您仔细合并,您可能不会丢失任何数据.如果这让您感到困扰,请使用更好的 VCS,例如 MercurialGit.

What is the best way to make one of the branches of a subversion repository the new trunk?

There has been a major rewrite for the entire system: things have been moved around, rewritten, replaces, removed, renamed etc. The rewritten code has been tested and is ready to replace the old trunk.

Basically, the the old mainline (Trunk 5) is tagged and will end here. The rewritten branch (Branch 6) is to become the new mainline (Trunk 7):

Trunk(1) --> Trunk(2) --> Trunk(5) --> ×          +--> new Trunk(7)
  \                             \                 |
  fork                         merge             ???
    \                             \               |
     +--> Branch(3) --> Branch(4) --> Branch(6) --+

All ongoing changes from the old 'Trunk' are already incorporated in the 'Rewritten branch'

How can I do this?

解决方案

Use svn move to move the contents of the old trunk somewhere else and rename the branch to trunk afterward.

Note that copy and move in svn work like file operations. You can use them to move/copy stuff around in your repository and these changes are versioned as well. Think of "move" as "copy+delete".

[EDIT] Nilbus just notified me that you will get merge conflicts when you use svn move.

I still think that this is the correct approach. It will cause conflicts but if you merge carefully, chances are that you won't lose any data. If that bothers you, use a better VCS like Mercurial or Git.

这篇关于svn:用分支替换主干的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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