如何使用 Eclipse 合并工具将 CVS 分支合并到 HEAD 中?

发布于 2024-07-13 13:50:12 字数 78 浏览 5 评论 0 原文

我目前在使用 Team-->Branch 创建的一个分支中工作。 如何使用 Team-->Merge 将我对分支的更改合并回头?

I'm currently working in a branch I created using the Team-->Branch. How do I use Team-->Merge to merge my changes to the branch back to head?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

鹿! 2024-07-20 13:50:13

我也遇到了这个问题。 以下是我进行合并的步骤(主要取自在线 Eclipse 帮助):

  1. 在创建我的开发分支(Team -> Branch)时,我确保为该分支创建了一个根标记,这是 CVS 将用来确定分支引起的更改以及其他工作可能提交的更改的标签
  2. 我在分支上完成了开发并提交(团队 -> 提交)所有更改 现在,我对
  3. 分支的所有更改都在存储库中,我加载要合并到的目标分支,通常是 HEAD(团队 -> 切换到另一个分支或版本

)现在准备开始实际的合并过程。 在这里,您将选择应该进行哪些更改以及应该放弃哪些更改。 将此过程视为半自动化的开发周期,实际上是一个检查、更改、提交周期。 只是您不必手动插入更改,而是可以使用比较工具来帮助您。 毕竟您已经在分支中进行了所有代码更改!

合并:

  1. 团队 -> 合并
  2. 分支或要合并的版本(结束标记):这是您的开发分支标记的名称。
  3. 通用基础版本:这是分支的根标记的名称(还记得上一节中的步骤 1 吗?) 。 这应该是由工具自动填充的,但如果没有,请自行添加。
  4. 我喜欢在同步视图中预览合并,这样我就可以确保没有任何不应该的内容进入。 根据您的勇敢程度,这是我建议的选择。 单击完成按钮,
  5. 将出现同步透视图,目标分支和源分支之间发现的任何差异都将显示在左侧的可扩展列表中
  6. 对于任何文件,您都可以在比较工具中打开它查看之前的内容并单独合并更改(记住完成后保存文件!),或者您可以右键单击文件并从可扩展列表中选择合并。 如果您使用比较工具手动合并,则可以在可展开列表中选择“标记为已合并”以从待办事项列表中删除该文件。
  7. 一旦您决定如何处理该文件,它将从列表中删除。 目标是操作每个文件
  8. 既然所有更改都已合并,请切换回 Java 透视图并选择“团队”->“团队”。 与存储库同步,同步透视图将重新出现。
  9. 这次选择“提交”将所有更改推送到存储库中。
  10. 鳍!

希望有帮助。
下面提供的就是指导我走向胜利的帮助文档的内容,仅供参考!

Eclipse SDK帮助 - 合并分支

I was having trouble with this too. Here are the steps I take to merge (mostly taken from the online Eclipse help):

  1. When making my development branch (Team -> Branch) I ensure I have a root tag created for the branch, this is the tag CVS will use to determine what changes are due to the branch and what might have been committed from other efforts
  2. I complete my development on the branch and commit (Team -> Commit) all changes back to the repository
  3. Now that all my changes for the branch are in the repository I load the destination branch that I want to merge into, typically HEAD (Team -> Switch to Another Branch or Version)

You are now ready to begin the actual Merging process. Here you will be picking which changes should come over and which should be discarded. Think of this process as a semi-automated development cycle, effectively a checkout, make changes, commit cycle. Only instead of manually inserting your changes you have compare tools to assist you along. After all you've already made all the code changes in your branch!

To Merge:

  1. Team -> Merge
  2. Branch or Version to be Merged (end tag): This is the name of your development branch tag
  3. Common Base Version: This is the name of your root tag for the branch (remember step 1 from the earlier section?). This should have been auto populated by the tool, but if not, add it yourself
  4. I like to Preview the merge in synchronize view so I can ensure that nothing is getting in that shouldn't be. Depending on your bravery, this is the option I would suggest. Click the Finish button
  5. The Synchronize Perspective will come up and any differences found between your destination branch and your source branch will be shown in an expandable list in the left
  6. For any file you can open it in a comparison tool to see what it was before and merge changes individually (remember to save the file when done!) or you can right click on the file and select merge from the expandable list. If you manually merge with the comparison tool, you can select "Mark as Merged" in the expandable list to remove the file from your todo list.
  7. Once you've decided what to do with the file it will be removed from the list. The goal is to action each file
  8. Now that all your changes have been merged, switch back to the Java perspective and select Team -> Synchronize with Repository, the Synchronize Perspective will come back up.
  9. This time select Commit to push all your changes into the repository.
  10. Fin!

Hope that helped.
Provided below for reference is the contents of the help document that guided me to victory!

Eclipse SDK Help - Merging a Branch

孤云独去闲 2024-07-20 13:50:13

确保目标已加载到您的工作区中。 这是最重要的部分,也是我在尝试做几次时错过的部分。

例如,如果您希望将更改合并到 HEAD 中,请确保该项目与工作区中的 HEAD 共享(而不是您一直在处理的分支)。 为此,请选择项目并选择“团队”>“团队”。 替换为> 上下文菜单中的另一个分支或版本。 然后选择要替换的分支。

从此时开始,选择“团队”> Merge,然后选择要合并到 HEAD 的分支。

Ensure that the destination is loaded into your workspace. This is the most important part and the part I missed when trying to do it a couple of times.

For example, if you wish to merge your changes into HEAD, make sure the project is shared with HEAD in your workspace(not the branch you have been working on). To do this, select the project and choose Team > Replace With > Another Branch or Version from the context menu. Then select the branch to replace with.

From this point, choose Team > Merge and then select the branch you want to merge into HEAD.

孤千羽 2024-07-20 13:50:13

我同意这是相反的,
如果 YOUR_BRANCH 中的更改需要更新到 HEAD,

1) 将更改提交到 YOUR_BRANCH
2)将本地分支交换到HEAD
3) 合并在 YOUR_BRANCH 中进行的 HEAD 更改,

因此您需要在 HEAD 中并从 YOUR_BRANCH 中“获取”更改(而不是将更改从 YOUR_BRANCH 发送到 HEAD)。

I agree this is working other way around,
if changes in YOUR_BRANCH needs to be updated to HEAD,

1) commit changes to YOUR_BRANCH
2) swap local branch to HEAD
3) merge HEAD witch changes made in YOUR_BRANCH

therefore you need to be in HEAD and "take" changes from YOUR_BRANCH (instead of sending changes from YOUR_BRANCH to HEAD).

咆哮 2024-07-20 13:50:13

我只得这么做。 虽然上面的答案很相似,但我发现它们并不具体针对我需要做的事情。

  • 如前所述,确保您的目标分支(通常是头分支)已签出。
  • 然后,突出显示您知道在分支(或整个项目,等等)中已更改的文件,然后选择“团队”->“团队”。 合并。 在弹出的对话框中,选择“分支或
    要合并的版本(结束标记)
    ”,
    你想要的源分支
    文件来自.
  • 就我而言,这辆车
    填充“通用基础版本
    (开始标记)
    ”,但如果不是,那么
    这将是创建的标签
    当分支被创建时。

当您预览更改时,它们将显示在正常的 CVS 同步视图中。 当您合并文件时,它们将作为更改被带入您的本地工作区(之前是您的目标分支)。 此时您需要将它们签入 CVS。

I just had to do this. While the answers above were similar, I found they weren't specific to what I needed to do.

  • As already stated, ensure your detination branch (usually head) is already checked out.
  • Then, highlight the files you know have changed in your branch (or the whole project, whatever), and select Team -> Merge. In the dialog box that pops up, choose for "Branch or
    version to be merged (end tag)
    ", the
    source branch you want to take your
    files from.
  • In my case this auto
    populated the "Common base version
    (start tag)
    ", but if it isn't, then
    this will be the tag that was created
    when the branch was created.

When you preview the changes they will appear in the normal CVS synchronise view. When you merge the files, they will be brought into your local workspace (which from earlier is your destination branch) as changes. At this point you will need to check them into CVS.

烟花易冷人易散 2024-07-20 13:50:13

我也为此苦苦挣扎,直到我选中“执行合并到本地工作区”单选按钮之前,上述答案都没有帮助。

不幸的是,在两个文件合并之前我无法预览合并。

I struggled with this also and the above answer was not helpful until I checked the "Perform the merge into local workspace" radio button.

Unfortunately, I was not able to preview my merge before the two files were merged.

偏闹i 2024-07-20 13:50:13

坦率地说,没有简单、干净的方法,除非您从分支时起就一直在预期和计划这次合并。

但是,我发现了一个完美运行的 hack,它 我在博客文章中描述过

Frankly, there is no easy, clean way unless you have been anticipating and planning for this merge right from the time you branched.

However, I found a hack that works perfectly, which I've described in a blog post.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文