Git stash (Save the current job site)

Source: Internet
Author: User
Tags using git

Command: Git stash

1. Using git stash to save the current work site , you can switch to another branch to work, or do other urgent work on the current branch, such as revising a bug test submission .

2. If a git stash is used to switch to a branch, and the work on that branch is not completed, it needs to save its work site. Then use Git stash. Then there are two job sites in the stash queue.

3. You can use Git stash list. View the stash queue.

4. What to do if you want to restore a job site on a branch: first use Git stash list to view the stash queue. Determine which work site to restore to the current branch . Then use git to stash pop [email protected]{num}. Num is the number of the job site you want to restore.

5. If you want to empty the stash queue, use git stash clear.

6. Also note that the use of the Git stash pop command is to restore the stash queue [email protected]{0}, which is the topmost job site. and using the pop command to recover the work site, its corresponding stash is deleted in the queue.
Using the git stash apply [email Protected]{num} method is not the same as Git stash pop except stash queue deletion.


=====

When you have an emergency job and don't want to commit to doing half of the work now, git stash and then switch to the other branch for emergency work.


Git stash (Save the current job 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.