mirror of https://github.com/CrimsonTome/tldr.git
git-stash: Make examples clearer
- Difference between a stash name and a stash message was not clear. For example, you cannot do: $ git stash save foo $ git stash apply foo fatal: ambiguous argument 'foo': unknown revision or path not in the working tree. - Difference between stash `apply` and `pop` was not clear - Make it clearer that all `apply`, `pop` and `drop` can take an optional stash name, and that the default name is `stash@{0}`waldyrious/alt-syntax
parent
95d348665b
commit
57fd36ec38
|
@ -4,24 +4,24 @@
|
||||||
|
|
||||||
- Stash current changes (except new files):
|
- Stash current changes (except new files):
|
||||||
|
|
||||||
`git stash save {{optional_stash_name}}`
|
`git stash save {{optional_stash_message}}`
|
||||||
|
|
||||||
- Include new files in the stash (leaves the index completely clean):
|
- Include new files in the stash (leaves the index completely clean):
|
||||||
|
|
||||||
`git stash save -u {{optional_stash_name}}`
|
`git stash save -u {{optional_stash_message}}`
|
||||||
|
|
||||||
- List all stashes:
|
- List all stashes:
|
||||||
|
|
||||||
`git stash list`
|
`git stash list`
|
||||||
|
|
||||||
- Re-apply the latest stash:
|
- Apply a stash (default is the latest, named stash@{0}):
|
||||||
|
|
||||||
`git stash pop`
|
`git stash apply {{optional_stash_name_or_commit}}`
|
||||||
|
|
||||||
- Re-apply a stash by name:
|
- Apply a stash (default is stash@{0}), and remove it from the list if applying doesn't cause conflicts:
|
||||||
|
|
||||||
`git stash apply {{stash_name}}`
|
`git stash pop {{optional_stash_name}}`
|
||||||
|
|
||||||
- Drop a stash by an index:
|
- Drop a stash (default is stash@{0}):
|
||||||
|
|
||||||
`git stash drop stash@{index}`
|
`git stash drop {{optional_stash_name}}`
|
||||||
|
|
Loading…
Reference in New Issue