| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <HTML> |
| <HEAD> |
| <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 start point of the merge. This is the version from which the branch |
| was created. Click <b>Next</b>.</li> |
| <li>Enter the branch or version which contains the changes you want to merge. |
| Click <b>Finish</b>.</li> |
| <li>A Merge editor will open, 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 and then choosing <b>Save</b> from the |
| text editor's context menu, or by choosing <b>Update from Repository</b>, |
| <b>Override and Update</b>, or <b>Merge Changes Into Local Copy</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> |
| <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>Update from Repository</strong></td> |
| <td width="80%">This action is enabled on files that contain incoming changes. |
| Running this action will bring the changes into the file in the workspace.</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>Merge changes Into Local Copy</strong></td> |
| <td>This action is enabled on files with conflicting changes. Running this |
| action will perform the equivalent of the "cvs update" command. |
| This will merge the local contents with the remote contents using the base |
| as the ancestor. Changes are merged regardless of the conflicting state |
| of the files and can result in conflict markers (e.g. lines that can't be |
| automatically merged) in the local file.</td> |
| </tr> |
| </table> |
| <p> </p> |
| <p><img border="0" src="../images/ngrelc.gif" alt="Related concepts" width="159" height="27"><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.gif" alt="Related tasks" width="159" height="27"><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.gif" alt="Related reference" width="159" height="27"> |
| <br><a href="../reference/ref-47.htm">CVS</a> |
| <br><a href="../reference/ref-41a.htm">Merge wizard</a> |
| </p> |
| |
| <p> <br> |
| <a href="../hglegal2003.htm"><img src="../images/ngibmcpy2003.gif" alt="Copyright IBM Corporation and others 2000, 2003" border="0" width="324" height="14"></a> |
| </p> |
| |
| </BODY> |
| </HTML> |