git stash

I feel like stash is another commits tree, but only one node. This is used for temporarily store away your current work directory.

When you type

This will firstly check if your work directory matches your commits or your stash. If not, it will gives you some error

Then, if you git stash your current work directory, if will allow you pull

git stash pop throws away the (topmost, by default) stash after applying it, whereas git stash apply leaves it in the stash list for possible later reuse (or you can then git stash drop it).

Leave a Reply

Your email address will not be published. Required fields are marked *