Git branch merge conflict resolution

Source: Internet
Author: User

Git's powerful branch management functions and its offline work make it widely used in various major enterprises.

Now that there are branches, there is of course the merge problem, and the advantage that git itself can work offline also brings a headache. Since it is offline work, so developers do not need to synchronize with the server all the time, so there will be conflicts when the branches are merged to the master. How can we solve the conflicts?

First, there are two solutions to the conflict detected when sourcetree is used to merge branches:

1) Use "My version" to resolve the conflict

2) Resolve conflicts with "others' versions"

After such processing, there will still be a possibility of conflict. You need to manually resolve the conflict.

Open a conflicting file and you will see the following mark:

<Mark conflict starts, followed by the content in the current branch.

HEAD points to the current branch end.

==========>>>>>>>> The code on another branch that requires merge to come over.

>>>>>> Is followed by the name of the branch to be merged.

In this case, you only need to manually delete the conflicting text, retain the latest version of the file to be merged, delete the logo, and merge again.

Install Git on Ubuntu Server

Create a Git repository on the server (Ubuntu)

Git simple tutorial in Linux (taking Android as an example)

Git authoritative guide PDF

Git details: click here
Git: click here

This article permanently updates the link address:

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.