Given the following stash content:
$ git stash list
stash@{0}: On fixes: animations-fixes
stash@{1}: WIP on master: 62aecaa Merge pull request #10 from SOURCE/branch-name
is there any way to have the same list, but including the date on which the stash was created?
A stash entry is just a regular git commit internally. So you can read its date ("commit date" or "author date") to know when it was created.
As mentioned in the manpage of git stash
, you can use the formatting options for git log
when invoking git stash list
. So to get the date, you could use git log
's option --format
:
git stash list --format="%gd: %ci - %gs"
This produces output like:
stash@{0}: 2014-04-23 11:36:39 +0500 - WIP on master: d072412 Do some stuff
That format uses %ci
, which prints the committer date in ISO 8601 format. Use %cr
for relative dates:
stash@{0}: 8 minutes ago - WIP on master: d072412 Do some stuff
See the manpage of git log
(section "PRETTY FORMATS") for more formatting options.
As others said, log
formatting applies. If you are looking for the default log format:
git stash list --pretty=medium
To see author and committer dates:
git stash list --pretty=fuller
And to inspect only one stash at a time (stash@{2}
in the example):
$ git log -1 --pretty=fuller stash@{2}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With