| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html lang="en"> |
| <HEAD> |
| |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
| <LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> |
| <title>Merging from a branch</title> |
| <meta name="keyword" content="team"> |
| </HEAD> |
| |
| <BODY BGCOLOR="#ffffff"> |
| <H1 CLASS="Head">Merging from a branch</H1> |
| |
| <P>After creating and working in a CVS branch for some time, you may want to merge |
| your changes from the branch into another branch, or into HEAD. To do this, |
| you will need to know: |
| </P> |
| |
| <ol> |
| <li>The name of the branch or version that contains your changes.</li> |
| <li>The version from which the branch was created. This is the version name |
| that you supplied when branching.</li> |
| </ol> |
| |
| <p>To merge your changes: |
| </p> |
| |
| <ol> |
| <li>Ensure that the destination is loaded into your workspace. For example, |
| if you wish to merge your changes into HEAD, make sure the project is shared |
| with HEAD in your workspace. To do this, select the project and choose <b>Replace |
| With > Another Branch or Version</b> from the context menu. Then select |
| the branch to replace with.</li> |
| <li>Select the project and choose <b>Team > Merge</b>.</li> |
| <li>Enter the branch or version which contains the changes you want to merge.</li> |
| <li>The merge dialog will try to guess an appropriate start point. If that fails, |
| enter the start point of the merge. This is the version from which the branch |
| was created. Click <b>Finish</b>.</li> |
| <li>A CVS Merge synchronization will be added to the Synchronize view, showing |
| all differences between your workspace and the branch with the changes.</li> |
| <li>Load all of the desired changes into the workspace. This may be accomplished |
| by either manually merging changes, or by choosing <b>Update</b>, <b>Override |
| and Update</b>, or <b>Mark as Merged</b> from the tree's context menu.</li> |
| <li>After all desired changes are in the workspace, choose <b>Team > Synchronize |
| with Repository</b>. You may then commit all the changes to the repository.</li> |
| </ol> |
| <p><em>Tip</em>: If you don't know the start point of the merge, you can choose |
| to perform the merge directly into the workspace. This relies on the CVS server |
| to pick an appropriate start point. Because the merge is performed directly |
| into the workspace, CVS may introduce a text based conflict markup into the |
| file. This markup is typically hard to deal with so merging directly into the |
| workspace should only be done when necessary.</p> |
| <h3>Merge actions</h3> |
| <p>The actions in the merge editor complement the manual merge toolbar actions |
| that are available in the bottom half of the merge editor.</p> |
| <table width="100%" border="0"> |
| <tr> |
| <td width="20%"><strong>Merge</strong></td> |
| <td width="80%">Running this action will bring the changes into the file in |
| the workspace. Any conflicts that are not auto-mergeable will be skipped.</td> |
| </tr> |
| <tr> |
| <td><strong>Override and Update</strong></td> |
| <td>This action is enabled on files with conflicting changes. Running this |
| action will discard any local changes you have and replace the file with |
| the remote contents.</td> |
| </tr> |
| <tr> |
| <td><strong>Mark as Merged</strong></td> |
| <td>This action will remove the selected changes from the view. The changes |
| will only reappear if the remote state of the resource changes and the CVS |
| Merge Synchronization is refreshed.</td> |
| </tr> |
| </table> |
| <p><em>Tip</em>: You can perform ongoing merges by pinning a CVS Merge Synchronization |
| in the Synchronize view. This will allow you to keep your workspace up-to-date |
| with the changes released to a different branch.</p> |
| <p><img border="0" src="../images/ngrelc.png" alt="Related concepts" ><br> |
| <a href="../concepts/concepts-26.htm">Team programming with CVS</a><br> |
| <a href="../concepts/concepts-27b.htm">Branches</a><br> |
| <a href="../concepts/concepts-30.htm">Synchronizing with a CVS repository</a> |
| </p> |
| |
| <p><img border="0" src="../images/ngrelt.png" alt="Related tasks" ><br> |
| <a href="tasks-100a.htm">Branching</a><br> |
| <a href="tasks-115.htm">Synchronizing with the repository</a><br> |
| <a href="tasks-113.htm">Updating</a><br> |
| <a href="tasks-114.htm">Committing</a> |
| </p> |
| |
| <p><img border="0" src="../images/ngrelr.png" alt="Related reference" > |
| <br> |
| <a href="../reference/ref-47.htm">CVS</a> <br> |
| <a href="../reference/ref-41a.htm">Merge wizard</a><br> |
| <a href="../reference/ref-33a.htm">CVS Merge Synchronization</a></p> |
| |
| |
| |
| </BODY> |
| </HTML> |