Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
The documentation for git stash list says list [<log-options>] List the stash entries that you currently have. Each stash entry is listed with its name (e.g. stash@{0} is the latest entry...
#3: Post edited
- [The documentation][doc] for `git stash list` says
- > ### [`list [<log-options>]`][doc]
- > List the stash entries that you currently have. Each **stash entry** is listed with its name (e.g. `stash@{0}` is the latest entry, `stash@{1}` is the one before, etc.), the name of the branch that was current when the entry was made, and a short description of the commit the entry was based on.
- > ```
- > stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation
- > stash@{1}: On master: 9cc0589... Add git-stash
- > ```
- > The command takes options applicable to the **git log** command to control what is shown and how. See [git-log[1]][log].
- If I run an ordinary `git stash list`, it shows me a list of `stash@{N}`, with lots of "WIP on branch1," "WIP on branch2," and so on.
- But if I try `git stash list -- doc` to look for stashes specifically affecting documentation, it does this…
- ```
- fatal: bad revision 'doc'
- ```
Why can't I use paths if it says I can use "log" options? Is it possible to get the list of stashes that touch a certain pathspec?- [doc]: https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-listltlog-optionsgt
- [log]: https://git-scm.com/docs/git-log
- [The documentation][doc] for `git stash list` says
- > ### [`list [<log-options>]`][doc]
- > List the stash entries that you currently have. Each **stash entry** is listed with its name (e.g. `stash@{0}` is the latest entry, `stash@{1}` is the one before, etc.), the name of the branch that was current when the entry was made, and a short description of the commit the entry was based on.
- > ```
- > stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation
- > stash@{1}: On master: 9cc0589... Add git-stash
- > ```
- > The command takes options applicable to the **git log** command to control what is shown and how. See [git-log[1]][log].
- If I run an ordinary `git stash list`, it shows me a list of `stash@{N}`, with lots of "WIP on branch1," "WIP on branch2," and so on.
- But if I try `git stash list -- doc` to look for stashes specifically affecting documentation, it does this…
- ```
- fatal: bad revision 'doc'
- ```
- If [the documentation says][doc] I can use _"options applicable to the **git log** command,"_ why won't it let me use path filtering? Is it possible to get the list of stashes that touch a certain pathspec?
- [doc]: https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-listltlog-optionsgt
- [log]: https://git-scm.com/docs/git-log
#1: Initial revision
Filter stashes by pathspec
[The documentation][doc] for `git stash list` says > ### [`list [<log-options>]`][doc] > List the stash entries that you currently have. Each **stash entry** is listed with its name (e.g. `stash@{0}` is the latest entry, `stash@{1}` is the one before, etc.), the name of the branch that was current when the entry was made, and a short description of the commit the entry was based on. > ``` > stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation > stash@{1}: On master: 9cc0589... Add git-stash > ``` > The command takes options applicable to the **git log** command to control what is shown and how. See [git-log[1]][log]. If I run an ordinary `git stash list`, it shows me a list of `stash@{N}`, with lots of "WIP on branch1," "WIP on branch2," and so on. But if I try `git stash list -- doc` to look for stashes specifically affecting documentation, it does this… ``` fatal: bad revision 'doc' ``` Why can't I use paths if it says I can use "log" options? Is it possible to get the list of stashes that touch a certain pathspec? [doc]: https://git-scm.com/docs/git-stash#Documentation/git-stash.txt-listltlog-optionsgt [log]: https://git-scm.com/docs/git-log