使用Eclipse在SVN中合并分支到中继 [英] Merging of branch to trunk in SVN using Eclipse

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

问题描述

我期待将我在SVN的分支开发的代码合并到中继线。我正在使用Eclipse,我一直在使用Team-> Commit来提交我对SVN的更新。但我以前没有做过合并。请帮我这个。谢谢

解决方案


  1. 首先确保你是最新的。更新目标分支的工作副本,即。你在哪里合并。在这个例子中,我们正在处理核心的中继线,我们想抓住维护分支中发生的更改并将其合并。

  2. 解决任何冲突。在工作副本和存储库之间的这个阶段应该没有冲突。

  3. 在工作副本上选择SVN合并选项。在Eclipse中,这将在团队菜单下找到,并称为合并分支。
    SVN:在Eclipse中合并

  4. 将From URL更改为要合并到工作副本的特定分支。在这个例子中,我们正在寻找p400维护分支(./core/branches/p400)。

  5. 将从修订更改为合并到目标分支的最后一个版本。从本质上说,您不想继续合并整个分支历史,您只需要在上次合并之后纳入这些更改。在Subversion中没有简单的方法可以确定此时的最后一个合并点。您必须检查您的消息日志,并查找有关合并的最后一个提交。如果您对用于合并的提交信息有所规定,应该很简单(见下文)。记下该版本是什么 - 您稍后在提交更改时需要这样做。
    SVN:与Eclipse合并

  6. 将修订更改为最新(即头)。记下修订版本 - 稍后在提交更改时需要更改。

  7. 单击合并并等待。根据差异有多大,这可能很快或Eclipse我刚刚跌倒。如果您有这样一个巨大的变化,您无法在Eclipse中完成它,您可能需要使您合并的修订范围更小。或者甚至可能要跳过某些修订,如果它们很大,可以手动执行。我们不时更新大型第三方库时遇到了这个问题。绝大多数时间你会很好。

  8. 查看更改并解决冲突。合并完成后,请查看对您的工作副本所做的更改,并确保解决您发现的任何冲突。

  9. 所有更改已在目标工作中解决复制,使用单个提交进行检查。你没有做很多提交的原因是这些是在合并的分支中应该记录的更改。提交消息需要采用特定的格式,详细说明合并,并在将来很容易找到。我们使用以下格式,但您可以使用适用于您的任何东西 - 只要您坚持下去。



    将[source]合并到[target]; [储存库。合并转[开始]:[结束]


享受!


I am looking forward to merge my codes which I developed in a branch of SVN to the trunk. I am using Eclipse and I have been using Team->Commit to commit my updates to the SVN. But I haven't done a merge before. Please help me with this. Thanks

解决方案

  1. First of all make sure you are up to date. Update your working copy of the target branch, ie. where you are merging into. In this example we're working on the trunk of "core" and we want to grab the changes that have happened in the maintenance branch and merge them.
  2. Resolve any conflicts. There should be no conflicts at this stage between the working copy and the repository.
  3. Select the SVN merge option on the working copy. In Eclipse this is going to be found under the "Team" menu and called "Merge Branch". SVN: Merging in Eclipse
  4. Change the From URL to the specific branch you want to be merged into your working copy. In this example we're looking for the p400 maintenance branch (./core/branches/p400).
  5. Change the From Revision to the last revision that was merged into the target branch. Essentially you don't want to keep merging the whole branch history, you just want to include those changes since the last time you merged. There is no easy way to determine the last merge point at this time in Subversion. You have to review your message log and look for the last commit that talks about merging. If you are disciplined about the commit messages you use for merging this should be easy (see below). Make a note of what that revision is -- you'll need this later when you commit your changes. SVN: Merge with Eclipse
  6. Change the To Revision to the latest (i.e. head). Make a note of what that revision is -- you'll need this later when you commit your changes.
  7. Click Merge and wait. Depending on how big the differences are this may be quick or Eclipse my just fall over. If you have such an enormous change that you can't get it done in Eclipse you may need to make the range of revisions you are merging smaller. Or you may even have to skip certain revisions and do them manually if they are massive. We've had this problem from time to time when updating large third-party libraries. The vast majority of the time you will be fine.
  8. Review changes and resolve conflicts. Once the merge is complete, look through the changes made to your working copy and make sure you address any conflicts you find.
  9. Once all the changes have been resolved in the target working copy, check them in with a single commit. The reason you're not doing lots of commits is that these are changes that should have been documented in the branch from which you merged. The commit message needs to be in a specific format that details the merge and is easy to find in the future. We use the following format, but you can use anything that works for you -- as long as you stick to it.

    Merging [source] to [target]; [repository]. Merge rev [start]:[end]

Enjoy!

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

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