git merge--squash overwrite commits

Source: Internet
Author: User
Tags commit

Tutorial 3 overwrites the submission. 7. Merge--squash

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

Download from here

We move to the STEPUP-TUTORIAL/TUTORIAL7 directory. The status of the local side history is shown in the following figure. Merges all commits of the Issue1 branch into a single commit and imports it into the master branch.

After switching to the master branch, specify the--squash option to perform the merge.

$ git checkout master
switched to branch ' master '
$ git merge--squash issue1
auto-merging sample.txt
CON Flict (content): merge conflict in Sample.txt
Squash commit – not updating HEAD
Automatic Merge failed; fix CONFL ICTs and then commits the result.

There seems to be a conflict. Please open sample.txt, modify the conflicting section, and then submit.

$ git add sample.txt
$ git commit
[master 0d744a7] Conflicts:   sample.txt
 1 files changed, 4 insertions (+) , 0 deletions (-)

All commits on the Issue1 branch are pooled and added to the master branch. Please use the log command to confirm the history.

From:http://backlogtool.com/git-guide/cn/stepup/stepup7_7.html

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.