Git rebase-i Modify Submit _git

Source: Internet
Author: User

Tutorial 3 overwrite submission. 6. Submit with Rebase-i modification

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

Download from here

We entered the STEPUP-TUTORIAL/TUTORIAL6 directory. The status of the local side's history is shown in the following figure. Here we modify the content of "add a Commit".

With Rebase-i, first select the commit to modify.

$ git rebase-i head~~

When you open the text editor, you will see the submission from head to head~~ as shown below.

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

# 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 = like "squash", but discard this commit ' s log message
#  x, exec = Run command (The rest of the line) using Shell
# If/# If you are
LOST.
# However, if you remove everything, the rebase would be aborted.
#

Change the first line of "pick" to "edit" and save and exit. The following content will be displayed, and the modified commit renders the exit status.

Stopped at D286baa ... Add a description of the commit you
can amend the commit now, with a

        git commit--amend

Once you are satisfied with your changes, RU n

        git rebase--continue

Open the Sample.txt and modify the "commit" section appropriately.

Even the monkeys know it. Git command
Add change entry into the index
the status of the commit record index
pull get the content of the remote database

Save the changes with a commit--amend.

$ git add sample.txt
$ git commit--amend

A commit has now been made, but the rebase operation is not over yet. To notify the completion of this commit operation, specify the--continue option to perform rebase.

$ git rebase--continue

Note

At this point, it is possible that other submissions will conflict, please modify the conflict section and then execute Add and rebase--continue. No submission is required at this time. If you want to stop the rebase operation in midstream, specify the--abort option in rebase so that you can erase and stop the operation in Rebase.

The submitted modifications are complete. If you want to modify multiple submissions to edit, the next commit to modify will exit, please perform the same modification.

Note

In fact, the submission before rebase will be in the name of Orig_head. If the rebase cannot be restored to its previous state, you can use git reset--hard orig_head to revert to the state before rebase.


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