mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 23:28:02 +00:00
Add Show What Is In A Stash as a git til
This commit is contained in:
@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
|||||||
For a steady stream of TILs from a variety of rocketeers, checkout
|
For a steady stream of TILs from a variety of rocketeers, checkout
|
||||||
[til.hashrocket.com](https://til.hashrocket.com/).
|
[til.hashrocket.com](https://til.hashrocket.com/).
|
||||||
|
|
||||||
_712 TILs and counting..._
|
_713 TILs and counting..._
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -198,6 +198,7 @@ _712 TILs and counting..._
|
|||||||
- [Show List Of Most Recently Committed Branches](git/show-list-of-most-recently-committed-branches.md)
|
- [Show List Of Most Recently Committed Branches](git/show-list-of-most-recently-committed-branches.md)
|
||||||
- [Show The diffstat Summary Of A Commit](git/show-the-diffstat-summary-of-a-commit.md)
|
- [Show The diffstat Summary Of A Commit](git/show-the-diffstat-summary-of-a-commit.md)
|
||||||
- [Show The Good And The Bad With Git Bisect](git/show-the-good-and-the-bad-with-git-bisect.md)
|
- [Show The Good And The Bad With Git Bisect](git/show-the-good-and-the-bad-with-git-bisect.md)
|
||||||
|
- [Show What Is In A Stash](git/show-what-is-in-a-stash.md)
|
||||||
- [Single Key Presses in Interactive Mode](git/single-key-presses-in-interactive-mode.md)
|
- [Single Key Presses in Interactive Mode](git/single-key-presses-in-interactive-mode.md)
|
||||||
- [Staging Changes Within Vim](git/staging-changes-within-vim.md)
|
- [Staging Changes Within Vim](git/staging-changes-within-vim.md)
|
||||||
- [Staging Stashes Interactively](git/staging-stashes-interactively.md)
|
- [Staging Stashes Interactively](git/staging-stashes-interactively.md)
|
||||||
|
|||||||
25
git/show-what-is-in-a-stash.md
Normal file
25
git/show-what-is-in-a-stash.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# Show What Is In A Stash
|
||||||
|
|
||||||
|
Usually when I want to inspect anything in git, I'll use `git show` with a
|
||||||
|
specific ref. This can even be done with stash refs.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git stash list
|
||||||
|
stash@{0}: WIP on ...
|
||||||
|
stash@{1}: Some commit on ...
|
||||||
|
|
||||||
|
$ git show stash@{0}
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
The `git-stash` command has a built-in way of showing stashes that will save
|
||||||
|
you from having to type out the somewhat awkward `stash@{n}` ref.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git stash show 1
|
||||||
|
```
|
||||||
|
|
||||||
|
This will show you the `stash@{1}` ref. You can also omit a number which
|
||||||
|
will show you the latest stash (`stash@{0}`).
|
||||||
|
|
||||||
|
See `man git-stash` for more details.
|
||||||
Reference in New Issue
Block a user