Git stash save modification site

Source: Internet
Author: User

Purpose: when you are working on a project on a branch, you suddenly have to stop and do other things, but because the project has not been changed, you can keep the site without the need to commit it, wait until you are busy and then reply to the site for further modification.

Bug handling stored at the development site
$ Git stash stores the current job site, so you can create branches with confidence to fix bugs.

First, determine the branch on which the bug will be fixed. If the bug needs to be fixed on the master branch, create a temporary branch from the master: $ git checkout master $ git checkout-B issue-101

After the repair is complete, switch to the master branch, complete the merge, and finally Delete the issue-101 Branch:
$ Git checkout master

$ Git merge -- no-FF-M "merged bug fix 101" issue-101

$ Git branch-d Issue-101

 

Use the GIT stash LIST command to view the storage work site
There are two ways to restore:

First, use git stash apply for recovery, but after recovery, the stash content is not deleted. You need to use git stash drop to delete it;

Another method is to use git stash pop to restore and delete the stash content.

You can use the GIT stash list to view and restore the specified stash multiple times. Run the following command: $ git stash apply [email protected] {0}

Git branch-D name forcibly deletes an unmerged Branch

Git stash save modification site

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.