| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html> |
| <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 content="text/html; charset=ISO-8859-1" |
| http-equiv="Content-Type"> |
| <meta content="text/css" http-equiv="Content-Style-Type"> |
| <link type="text/css" charset="ISO-8859-1" href="../book.css" |
| rel="STYLESHEET"> |
| <title>Working with conflicting changes</title> |
| </head> |
| <body style="background-color: rgb(255, 255, 255);"> |
| <h3>Working with conflicting changes<br> |
| </h3> |
| <p class="Para">There are cases where two users are editing the same files and |
| when the second to commit to the repository tries to commit their changes, the |
| repository won't allow the commit to succeed because of the conflict. Let's |
| simulate this by making Fred and Jane change the same files.<br> |
| </p> |
| <ol> |
| <li>In Fred's workspace open one of the navigation views and edit file1.txt. Make |
| the text the following:<br> |
| <br style="font-style: italic;"> |
| <span style="font-style: italic;">Fred line 1</span><br |
| style="font-style: italic;"> |
| <span style="font-style: italic;">This is the contents</span><br |
| style="font-style: italic;"> |
| <span style="font-style: italic;">Fred-update</span><br |
| style="font-style: italic;"> |
| <span style="font-style: italic;">of file 1.<br> |
| <br> |
| </span></li> |
| <li><span style="font-style: italic;"><span |
| style="font-style: italic;"></span></span>Fred will also change |
| file2.txt with the following change:<br> |
| <br> |
| <span style="font-style: italic;">File2 is a (Fred was here again) |
| small file</span><br style="font-style: italic;"> |
| <span style="font-style: italic;">with simple text.</span><br> |
| <br> |
| </li> |
| <li>Fred committed his changes to the repository.<br> |
| <br> |
| </li> |
| <li>Next, at the same time Jane was making changes to file1.txt. She |
| added the following line to the end of the file:<br> |
| <br> |
| <span style="font-style: italic;">This is the contents</span><br |
| style="font-style: italic;"> |
| <span style="font-style: italic;">Fred-update</span><br |
| style="font-style: italic;"> |
| <span style="font-style: italic;">of file 1.</span><br |
| style="font-style: italic;"> |
| <span style="font-style: italic;">Jane was at the end<br> |
| <br> |
| </span></li> |
| <li>And finally, Jane changed file2.txt to the following:<br> |
| <br> |
| <span style="font-style: italic;">File2 is a (Jane was here) small |
| file</span><br style="font-style: italic;"> |
| <span style="font-style: italic;">with simple text.<br> |
| <br> |
| </span></li> |
| <li>When Jane was finished making changes she synchronized the |
| project and found the following appear in the Synchronize View:<br> |
| <br> |
| <img src="../images/Image83_jane3_conflict.png"> |
| <br> |
| <br> |
| </li> |
| <li>Both file1.txt and file2.txt show with a red icon indicating that they have |
| conflicting changes. You can't commit the files until the conflicts are resolved. |
| Click on file1.txt and notice that Fred and Jane made changes to two different |
| parts of the file. In this case, Jane can simply update the file and the lines |
| added by Fred will be merged into Jane's local file. Select file1.txt and |
| from the context menu select <strong>Update</strong>.<br> |
| <br> |
| </li> |
| <li>Next, double on file2.txt to see the conflict. In this case you can see |
| that both Jane and Fred changed the same line. For this type of conflicting |
| change a regular update can't resolve the conflict. Here you have three options |
| (with the command to use in brackets): accept the changes from Fred (<span style="font-weight: bold;">Override |
| and Update</span>), ignore Fred's changes (<span style="font-weight: bold;">Mark |
| as Merged</span>), or manually merge the files within the compare editor.<br> |
| <br> |
| <img src="../images/Image83_jane3_conflict2.png"> |
| <br> |
| <br> |
| </li> |
| <li>For this example, let's say Jane updated file1.txt and selected |
| override and update for file2.txt. After the operations are run the |
| conflicts turn into outgoing changes. Jane can review the changes and |
| commit them.<br> |
| </li> |
| </ol> |
| |
| </body> |
| </html> |