You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stash@{2}: WIP on master: 21d80a5 added number to log
70
70
----
71
71
72
-
In this case, two stashes were done previously, so you have access to three different stashed works.
72
+
In this case, two stashes were saved previously, so you have access to three different stashed works.
73
73
You can reapply the one you just stashed by using the command shown in the help output of the original stash command: `git stash apply`.
74
74
If you want to apply one of the older stashes, you can specify it by naming it, like this: `git stash apply stash@{2}`.
75
75
If you don’t specify a stash, Git assumes the most recent stash and tries to apply it:
@@ -132,7 +132,7 @@ You can also run `git stash pop` to apply the stash and then immediately drop it
132
132
==== Creative Stashing
133
133
134
134
There are a few stash variants that may also be helpful.
135
-
The first option that is quite popular is the `--keep-index` option to the `stash save` command.
135
+
The first option that is quite popular is the `--keep-index` option to the `git stash` command.
136
136
This tells Git to not only include all staged content in the stash being created, but simultaneously leave it in the index.
137
137
138
138
[source,console]
@@ -152,6 +152,7 @@ M index.html
152
152
Another common thing you may want to do with stash is to stash the untracked files as well as the tracked ones.
153
153
By default, `git stash` will stash only modified and staged _tracked_ files.
154
154
If you specify `--include-untracked` or `-u`, Git will include untracked files in the stash being created.
155
+
However, including untracked files in the stash will still not include explicitly _ignored_ files; to additionally include ignored files, use `--all` (or just `-a`).
155
156
156
157
[source,console]
157
158
----
@@ -197,7 +198,7 @@ Saved working directory and index state WIP on master: 1b65b17 added the index f
197
198
198
199
If you stash some work, leave it there for a while, and continue on the branch from which you stashed the work, you may have a problem reapplying the work.
199
200
If the apply tries to modify a file that you’ve since modified, you’ll get a merge conflict and will have to try to resolve it.
200
-
If you want an easier way to test the stashed changes again, you can run `git stash branch <branch>`, which creates a new branch for you with your selected branch name, checks out the commit you were on when you stashed your work, reapplies your work there, and then drops the stash if it applies successfully:
201
+
If you want an easier way to test the stashed changes again, you can run `git stash branch <new branchname>`, which creates a new branch for you with your selected branch name, checks out the commit you were on when you stashed your work, reapplies your work there, and then drops the stash if it applies successfully:
0 commit comments