Saving and applying stashes
When stashing away work, we can easily have more than one state stashed away at a time. However, the default names for stashed away changes aren't always helpful. In this example, we'll see how we can save stashes and name them so that it is easy to identify them again when listing the content of the stash. We'll also learn how to apply a stash without deleting it from the stash list.
Getting ready
We'll use the same repository as in the previous example, continuing from the state we left it in:
$ cd Git-Version-Control-Cookbook-Second-Edition_tips_and_tricks
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: foo
$ git stash list
stash@{0}: WIP on master: 4447f69 Update foo
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
How to do it...
To save the current state to a stash with a description we can remember at...