Troubleshooting Eclipse svn file conflicts

Source: Internet
Author: User
Tags svn

In the process of team development using the Eclipse SVN plugin, suppose that developers A and B both get the latest version of the same file (if the version number is 8) and change it, member A has submitted its own changes (the version number becomes 9), and if member B wants to commit its own changes at this point, There is a high likelihood of conflict with the changes that member B has committed.

As shown in the Eclipse SVN sync view, Test.java is a file that produces a version conflict, so how do we resolve the svn file conflicts?

1. Resolve Simple File version conflicts

For a file that produces version conflicts, if two people change not the same location, for example, member A only changes the file header, member B only changes the end of the file, then there is no need to worry too much, because now SVN is very smart, as long as the two changes do not affect each other, SVN can intelligently merge it, The final result is the file header is the result of a change, the tail is the result of B changes, the middle remains unchanged.

In this case, we can directly right-click on the file, first in the context menu by clicking "Update", the server changes to update to local, and then click "Submit".

2. Resolve the file version conflict of the two selection form

After comparing the files, if we find that the two changes are in the same location or the same function point, then we may need to selectively keep one and discard the other.

If you discard a local file, right-click the file, and then click Overwrite/Update in the context menu (English: Replace/update), at which time eclipse will prompt "whether to delete local changes and replace with files in the repository", and click "Yes" to discard local changes. and update to the latest version in the repository.

If you discard a file from the repository, right-click the file, then click "Mark Merge" in the context menu, then click "Submit".

3. Resolve complex file version conflicts

If the file changes in the local and the repository are "every need" and "each discard", then we can only compare the differences in the file comparison, and gradually change to the final version.

In the process of modifying and merging, it is important to have two icon buttons. As shown in the red border callout of the two icons, the former can be the right and local files without conflicting changes copied to the left local file (for example, only the main () method conflicts, the right Sayhi () method does not conflict, the right side of the Sayhi () The method section is copied to the matching location on the left side of the file, which is used to copy the right-hand area of the mouse cursor to the appropriate location on the left.

After confirming that the changes are complete, click "Mark as Merge" in the context menu of the right button, and then "submit" directly.

Reprint----Software Compass (http://www.softown.cn), reproduced please keep the source! It's very well written.

Troubleshooting Eclipse svn file conflicts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.