Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I merge a CVS branch into HEAD using the Eclipse merge tools?

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?

like image 954
Alex Argo Avatar asked Feb 09 '09 22:02

Alex Argo


People also ask

How do I Merge a branch from another branch in Eclipse?

Your task is to merge a different branch into that branch. After doing a "fetch" to ensure that your branch metadata is up to date, right-click on the repository and select "Merge...". Select the branch you want to merge into your current branch. After that completes, inspect the "Git Staging" view.

How do I Merge in Eclipse?

To start merging click 'Team>Merge...' menu item of the resource pop-up menu, 'Merge...' menu item of the SVN main menu group or on the 'Merge...' button on the 'SVN Toolbar'. The Merge Dialog will appear and to perform operation user should follow its instructions and fill needed properties.

How to create a new branch in CVS?

Making a Branch You can make a branch with the -b option to the cvs tag or cvs rtag commands. This option can be combined with any of the other tag-creation options of those commands. You can use a date, existing tag, or revision number to specify the revision to be branched from.


1 Answers

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

like image 106
Brian Avatar answered Oct 11 '22 03:10

Brian