合并分支与树干 [英] Merge branch with trunk

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

问题描述

使用TortoiseSVN,我需要在分支中进行更改,然后将其与主干合并。

Using TortoiseSVN, I need to take changes I've done in a branch and then merge them with trunk.

我是该项目的唯一开发人员,所以我知道主干没有改变。我正在学习SVN,以便最终我的团队可以使用它。

I am the only developer on this project, so I know trunk hasn't changed. I am learning SVN so that eventually my team can use it.

基本上,我希望我的树干看起来像分支一样。

Basically, I want my trunk to look exactly like the branch.

在pre-svn世界中,我只需要复制分支文件夹中的文件,删除中继文件夹中的文件,然后将分支复制到中继中即可。

In pre-svn world, I would just copy the files in my branch folder, delete the files in the trunk folder, and then copy branch into trunk.

在TortoiseSVN中,我尝试过重新集成分支合并一系列修订合并两个不同的树。似乎并没有改变树干。我还尝试过在树干顶部分支。

In TortoiseSVN, I've tried Reintegrate a branch, Merge a range of revisions, and Merge two different trees. Nothing seems to actually change trunk. I've also tried branching on top of the trunk. This gives me an error, saying that the trunk already exists.

推荐答案

在您的情况下:


  1. 将工作副本切换到主干(SVN交换机)

  2. 将分支合并到工作副本中(SVN合并)

  3. 确保所有内容仍可以编译并正常工作

  4. 提交工作副本(主干)

  5. 考虑杀死分支

  1. Switch the working copy to the trunk (SVN Switch)
  2. Merge the branch into the working copy (SVN Merge)
  3. Make sure everything still compiles and works
  4. Commit the working copy (the trunk)
  5. Consider killing the branch

团队环境中,建议您首先合并分支机构主干中的最新修改,确保所有内容都能编译并正常工作,然后执行上述步骤(由于您已经测试了更改,因此这很简单)。

In a team environment I would suggest that you first merge the latest modifications from the trunk in your branch, make sure that everything compiles and works, then do the above steps (which will be trivial since you've already tested the changes).

更新

在步骤5中,我提到杀死分支。这是因为一旦某个功能的分支进入主干,则应将其视为主干的一部分。在这种情况下,应该杀死该分支,以便没有人继续努力。如果需要对该功能进行重大修改,则应为此创建一个新分支。

In step 5, I mention killing the branch. That's because once a branch from a feature is in the trunk, it should be considered as part of the trunk. In that case the branch should be killed so that no one keeps working on it. If major modifications are needed for that feature, you should create a new branch for that.

我唯一要杀死的分支是维护和发布分支,除非

The only branches that I don't kill are maintenance and release branches, unless a particular release is no longer supported.

无论如何,您始终可以访问每个修订版,因此杀死分支仅用于防止其他开发人员在失效的分支上进行开发

No matter what, you always have access to every revision so killing a branch is only used to prevent other developers from developing on a dead branch.

这篇关于合并分支与树干的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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