Git Stash Staging current work

Source: Internet
Author: User

Git stash can be used to stage the current work, such as to pull the latest code, do not want to add a new commit, or another situation, in order to fix an urgent bug, first stash, so that return to their previous commit, change the bug after the stash pop, Continue the original work.
Basic command:
$git Stash
$do some work
$git Stash Pop

Advanced:

Git stash save "work on progress for Foo feature"

When you use the ' git stash ' command multiple times , your stack will be filled with uncommitted code, and you'll be confused about which version to apply back,

'git stash list' command can print the current git stack information, you just need to find the corresponding version number, for example, using 'git stash apply [email protected]{1} ' can you specify the version number of [ The work of email protected]{1} is taken out and when you apply all the stacks back, you can use 'git stash clear' to empty the stack.

git stash          # Save uncommitted changes# Pull, edit, Etc.git stash list     # list stashed changes in this gitgit show [E Mail protected]{0} # See the last stash git stash pops      # Apply last stash and remove it from the Listgit stash--help
   # for more info

Git Stash Staging current work

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.