git Cherry-pick overwrite commits

Source: Internet
Author: User
Tags commit

Tutorial 3 overwrites the submission. 4. Cherry-pick

To save time, this tutorial uses the existing history as a local database.

Download from here

We enter the Stepup-tutorial/tutorial4 directory. The status of the local-side history is shown in the following figure. Only the "Add commit" modifications performed in other branches are imported to the Master branch.

After moving the changes to the master branch, use Cherry-pick to remove the "add a Commit" submission and add it to master. (The submission "99DAED2" in the document and the download to the database may not be the same.) Execute git log in the downloaded database and confirm that it is correct before you use it. )

$ git checkout master
switched to branch ' master '
$ git cherry-pick 99daed2
error:could not apply 99daed2 ...  Commit
Hint:after Resolving the conflicts, mark the corrected paths
hint:with ' git add <paths> ' or ' git rm <paths> '
Hint:and commit the result with ' git commit '

If there is a conflict, open sample.txt, modify the conflicting section, and then commit.

$ git add sample.txt
$ git commit

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.