Resolve Git branch merge conflicts in Eclipse

Source: Internet
Author: User

Conflict scenarios:

There is a file student.py on the master branch.

Add a new dev branch to master

Modify the file student.py on the Dev branch. Add function def d ():, and commit;

Modify the file student.py on the master branch. Delete Function def a ():, and commit;

To merge the Dev branch on the master branch, Git prompts for conflicts such as:

Cause Analysis:

The file student.py has been modified on both the master and dev branches, causing the merge to be an error, for specific reasons

Http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/ 001375840202368c74be33fbd884e71b570f2cc3c0d1dcf000

Workaround:

Check for conflicting reasons, git command for git status

The image is displayed on Eclipse, the red file is a conflict file, open the red file, see the conflict details, such as:

Need to manually handle the content between <<<<<<< HEAD >>>>>>> Refs/heads/dev, manually merging the code, removing the <<< <<<< HEAD >>>>>>> Refs/heads/dev These two lines of content will then be processed after the student.py file is on the add to Index,eclipse as action But the red disappears after success, then the commit push.

We

Resolve Git branch merge conflicts in Eclipse

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.