Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse Workbench User Guide
Previous Page Home Next Page

Working with conflicting changes

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.

  1. In Fred's workspace open one of the navigation views and edit file1.txt. Make the text the following:
    Fred line 1
    This is the contents
    of file 1.
  2. Fred will also change file2.txt with the following change:
    File2 is a (Fred was here again)
    with simple text.
  3. Fred committed his changes to the repository.
  4. Next, at the same time Jane was making changes to file1.txt. She added the following line to the end of the file:
    This is the contents
    of file 1.
    Jane was at the end
  5. And finally, Jane changed file2.txt to the following:
    File2 is a (Jane was here) small file
    with simple text.
  6. When Jane was finished making changes she synchronized the project and found the following appear in the Synchronize View: Conflict shown in Synchronize view and Compare editor
  7. 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 Update.
  8. 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 (Override and Update), ignore Fred's changes (Mark as Merged), or manually merge the files within the compare editor. Compare editor showing conflict
  9. 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.

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire