git rebase-i Convergence commit

Source: Internet
Author: User
Tags commit join

Tutorial 3 overwrites the submission. 5. Submit with Rebase-i Convergence

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

Download from here

We enter the STEPUP-TUTORIAL/TUTORIAL5 directory. The status of the local side history is shown in the following figure. Here you'll join the "add commit" and "add pull" changes, then merge to a commit.

To join a past submission, use Rebase-i.

$ git rebase-i head~~

Open the text editor and you will see a submission from head to head~~ as shown in the following figure.

Pick 9a54fd4 Add a description of the commit
pick 0d4a808 Add a pull description

# Rebase 326fc9f: 0d4a808 onto D286baa
#
Commands:
#  p, pick = use commit
#  r, reword = use commit, but edit the C Ommit Message
#  E, edit = use commit, but stop for amending
#  s, squash = use commit, but meld into prev IOUs commit
#  F, fixup = "squash", but discard this commit ' s log message
#  x, exec = Run command (The rest of the line) using Shell
#
# If You remove a line here, COMMIT would be LOST.
# However, if you remove everything, the rebase would be aborted.
#

Change "Pick" in the second line to "squash" and save and exit. Since the merge is submitted, the editor for submitting information is then displayed, please edit the information and then save and exit.

In this way, two commits are merged into one commit. Please use the log command to confirm the history.


From: http://backlogtool.com/git-guide/cn/stepup/stepup7_5.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.