Egit User Manual of git plug-in on Eclipse _ solving push conflicts

Source: Internet
Author: User
Tags using git

In the case of collaborative development by multiple people, conflicts may occur when pushing updates to the server. Therefore, the latest version and local repository on the server must be resolved before pushing. The pull operation is to pull updates from the server to the local warehouse for merge. After the merge conflicts are solved, the update can be smoothly pushed to the server branch.

Assume that mairo is using git to develop newsupermairobro games. Currently, the mushroom. Java file on the server is as follows:

After mairobro cloned the code, mairo's brother made the following changes:

Mairo's younger brother made the following changes:

Then mairo's younger brother pushes the code first. mairo's older brother uses pull to merge the local repository and remote repository, and conflicts with the release files. Git automatically merges the conflicting files, as shown in:

Obviously, the automatically merged conflicting files cannot be directly used. You can manually adjust them, right-click the files that conflict, and choose team> merge tool.

The first is to compare the files automatically merged by git with those on the server.

The second option is to use the latest local file and the Server File for comparison. We recommend that you use this option.

Next is the familiar comparison interface.

Mairo's brother modified the conflict file as follows:

Right-click the conflicted file and choose "team"> "add to index" to add the file to index control again. At this time, the file is not in conflict state and can be submitted and pushed to the server.

After the merge conflicts are resolved, mairo's younger brother only needs to merge the merged version pull on the server to the local machine to complete the code merging for collaborative development. From the history records, we can see that starting from mushroom, history enters the branch, first the mushrooma record, then the mushroomb record, and finally the historical branch is merged.

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.