手把手教你在Eclipse中使用CVS Branch功能

Brach 的作用:

开发新版本的人员就基于 main trunk 工作,而 fix bug 的人员就基于 branch 工作。 
一旦在 branch上将 Release_1_0的 bug修复了,我们就可以将 Release_1_0 Branch合并到 main trunk中来,从而一次性 remove the bugs。

建立 Branch:

1, 在建立 Branch之前,必须先打好一个 cvs版本。

projectà Right click your project name, choose Team à Tag as version 输入版本号 Release_1_0,按确认后就打好一个版本了;

2, Checkout Release_1_0这个版本。

projectà Right click your project name, choose Team à Another branch or version。选择对应的Release_1_0版本, Replace。

3, 建立 Branch:

在 projectà Right click your project name, choose Teamà branch.输入 Branch号:Release_1_0_Branch。这样我们在 version Release_1_0建立一个 branch叫做 “Release_1_0_Branch”, 这时CVS会同时建立一个 regular tag “Root_of_Releas_1_0_Branch”,这个 “Root_of_Releas_1_0_Branch” tag的用途是为了以后 branch 合并到 main trunk时提供一个参考点 (Eclipse CVS看不到的 ) 。

合并 branch (Merge):

fix bug之后,这时我们要把 Branch  merge main trunk 了。

1、选择 project -> Right click your project name, choose Replace With > Another Branch or Version from the context menu,
 Then select the HEAD to replace with your current version in your workplace。

2、 Select the project and choose Team > Merge.

在随后出现的对话框中,你首先选择 regular tag ”Root_of_Releas_1_0_Branch”,然后在下一步中选择你的Branch“Release_1_0_Branch”。

3、 Synchronize view中的操作

在第二步结束后, Synchronize view中将显示 “all the differences between the branch and your workspace version(that is the HEAD version)”,你必须在 Synchronize view中通过菜单中提供的 “Update, Override and Update, or Mark as Merged”手工决定合并到你工作区的 change。


4、在所有期望的 changes都被 merge到你的工作区后,你就可以 “commit” the changes to the repository了。

摘自:http://sesame.iteye.com/blog/426430

原文地址:https://www.cnblogs.com/antyi/p/4380896.html