Git Learning (8)

Source: Internet
Author: User

Suppose you are currently working on the Dev branch, but you need to fix the bug right away, how do you handle it?

Since the work of Dev is not yet completed, it cannot be submitted,

1, use the git stash command to save the current job site, and so on after the recovery site to continue to work.

Git stash

2, assuming the bug is on the master branch, create a temporary branch from master

git checkout Master

Git checkout-b issue-101

3, modify the bug, then add to staging area, and submit

git add readme.txt

git commit-m ' fix bug 101 '

4, switch to Master branch, merge, delete issue-101 branch.

git checkout Master

git merge--no-ff-m ' merge bug fix101 ' issue-101

Git branch-d issue-101

5, back to Dev branch

git checkout Dev

6. View the Job Site

git stash List

7. Resume worker Thread

Git stash pop

It also removes the stash content while recovering.

Git Learning (8)

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.