Git Stash Introduction

Source: Internet
Author: User

Original: http://gitbook.liuhui998.com/4_5.html

I. Basic operation when you are doing a complex job, you find a bug that is not relevant to your current job but is annoying. You want to fix the bug and do the work at hand, then you can use Git stash to save the current state of work, after you fix the bug, the "anti-storage" (Unstash) operation can go back to the previous work. $ git stash save "working in Progres S for Foo feature "This command will save your local modifications to the storage (stash), and then reset all your working directory and index contents back to the state of the last commit of your current branch. OK, you can start your repair work now .... Edit  and test ... $ git commit-a-M "Blorpl:typofix" after you fix the bug, you can use Git stash apply to revert to the previous working state. ?? The code that modifies the bug will be submitted and will remain in the local code after apply? $ git stash apply second, storage queue you can also use the ' git stash ' command multiple times, and each time you execute it, the ' storage ' (stash) for the current modification is added to the storage queue. Use the ' Git Stash list ' command to view your saved ' storage ' (stashes): $>git stash List[email protected]{0}: WIP on book:51bea1d ... fixed images[em Ail protected]{1}: WIP on Master:9705ae6 ... changed the browse code to the official repo can be used like ' git stash apply ' [email prot ected]{1} ' command to use any of the ' storage ' (stashes) in the queue. ' Git stash clear ' is used to empty this queue.

Git Stash Introduction

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.