|
26 | 26 | * [Pick commits across branches using cherry-pick](https://github.com/git-tips/tips#pick-commits-across-branches-using-cherry-pick)
|
27 | 27 | * [Find out branches containing commit-hash](https://github.com/git-tips/tips#find-out-branches-containing-commit-hash)
|
28 | 28 | * [Git Aliases](https://github.com/git-tips/tips#git-aliases)
|
| 29 | +* [Saving current state of tracked files without commiting](https://github.com/git-tips/tips#saving-current-state-of-tracked-files-without-commiting) |
| 30 | +* [Show list of all saved stashes](https://github.com/git-tips/tips#show-list-of-all-saved-stashes) |
| 31 | +* [Apply any stash without deleting from the stashed list](https://github.com/git-tips/tips#apply-any-stash-without-deleting-from-the-stashed-list) |
| 32 | +* [Apply last stashed state and delete it from stashed list](https://github.com/git-tips/tips#apply-last-stashed-state-and-delete-it-from-stashed-list) |
| 33 | +* [Delete all stored stashes](https://github.com/git-tips/tips#delete-all-stored-stashes) |
29 | 34 |
|
30 | 35 | <!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
|
31 | 36 | <!-- @doxie.inject end toc -->
|
@@ -161,5 +166,42 @@ git config --global alias.<handle> <command>
|
161 | 166 | git config --global alias.st status
|
162 | 167 | ```
|
163 | 168 |
|
| 169 | +## Saving current state of tracked files without commiting |
| 170 | +```sh |
| 171 | +git stash |
| 172 | +``` |
| 173 | + |
| 174 | +## Show list of all saved stashes |
| 175 | +```sh |
| 176 | +git stash list |
| 177 | +``` |
| 178 | + |
| 179 | +## Apply any stash without deleting from the stashed list |
| 180 | +```sh |
| 181 | +git stash apply <stash@{n}> |
| 182 | +``` |
| 183 | + |
| 184 | +## Apply last stashed state and delete it from stashed list |
| 185 | +```sh |
| 186 | +git stash pop |
| 187 | +``` |
| 188 | + |
| 189 | + |
| 190 | +__Alternatives:__ |
| 191 | +```sh |
| 192 | +git stash apply stash@{0} && git stash drop stash@{0} |
| 193 | +``` |
| 194 | + |
| 195 | +## Delete all stored stashes |
| 196 | +```sh |
| 197 | +git stash clear |
| 198 | +``` |
| 199 | + |
| 200 | + |
| 201 | +__Alternatives:__ |
| 202 | +```sh |
| 203 | +git stash drop <stash@{n}> |
| 204 | +``` |
| 205 | + |
164 | 206 | <!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
|
165 | 207 | <!-- @doxie.inject end -->
|
0 commit comments