Save and restore progress using the git stash command

Source: Internet
Author: User

Save and resume progress with git stash command git stash

Saving the current work progress will save the staging area and workspace changes. After executing this command, when you run the git status command, you will find that you are currently in a clean workspace with no changes. Use git stash save ‘message...‘ to add some comments

git stash List

Displays a list of saved progress. It also means that the git stash command can be executed multiple times.

git stash pop [–index] [stash_id]
    • git stash popRestores the latest progress to the workspace. git defaults to restoring workspace and staging area changes to the work area.
    • git stash pop --indexRestore the latest progress to the workspace and staging area. (Try to restore the original staging area changes to staging area)
    • git stash pop [email protected]{1}Restores the specified progress to the workspace. STASH_ID is git stash list obtained by command.
      git stash popthe current progress is deleted after the progress is resumed with the command.
git stash apply [–index] [stash_id]

In addition to not deleting the progress of the recovery, the rest is the git stash pop same as the command.

git stash drop [stash_id]

Deletes the progress of a store. If you do not specify STASH_ID, the latest storage progress is deleted by default.

Git stash Clear

Deletes the progress of all the stores.

Source: CSDN Original: 73810577?utm_source=copy

Save and restore progress using the git stash command

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.