I was having trouble with this too. Here are the steps I take to merge (mostly taken from the online Eclipse help):
- 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
- I complete my development on the branch and commit (Team -> Commit) all changes back to the repository
- 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:
- Team -> Merge
- Branch or Version to be Merged (end tag): This is the name of your development branch tag
- 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
- 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
- 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
- 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.
- Once you've decided what to do with the file it will be removed from the list. The goal is to action each file
- 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.
- This time select Commit to push all your changes into the repository.
- 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