Git cherry-pick Conflict resolution __git common skills

Source: Internet
Author: User

1. It is known that a commit between different branches can be used to obtain submissions from other branches using the git cherry-pick command. If the general situation is not a problem, we click Cherry-pick Copy link.


In our local warehouse directly using the link we just copied, you can cherry-pick success. But joining us Cherry-pick failed. Here we will analyze the problem of failure.

Error Stories

Conflict code (after cherry pick)

Hal3/camera3stream.cpp \

1.<<<<<<< Head//indicates that the head of the code we cherry pick over here is where the code changes to start.

# Hal1.0/src/camerahardwareinterface.cpp

2.=======

5.hal3/camera3flash.cpp \/This is the point of conflict, before the CameraHardwareInterface.cpp in front of the CameraHardwareInterface.cpp file added

3.hal1.0/src/camerahardwareinterface.cpp

4.>>>>>>> 9fc22d0 ... Bug #534024-[apps_tj][customer needs]

endif here in order to resolve the conflict, we removed 1.2.3.4 Lines and placed 5 at 1 label locations. And then


git Add.

Git commit

This time we will find the following red words, this is because we cherry-pick come over when I, due to conflict, saved history.

================================================

[Tag_product] Common

Conflicts:

Camera.mk

Hal3/camera3hal.cpp

Change-id:i5bef49017323f041857d5498939a9d4d6992d4e0 ================================================

If we don't get rid of conflicts, we'll have the following problem when git push (two Change-id will be available)

Remote: [tag_product] Common

Remote

Remote:change-id:id4c396b9d8d9607af7cd69df76da547e51193ab7

Remote

Remote:conflicts:

Remote

Remote:Camera.mk

Remote:hal3/camera3hal.cpp

Remote

Remote:change-id:i5bef49017323f041857d5498939a9d4d6992d4e0

Delete the word conflicts and git the push so that we can keep the previous change-id without regenerating a change-id.

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.