问题
Is there a way to retrieve the commit from which a stash was originally created?
When creating a stash with the default command git stash
the original commit is saved in the stash message, so it usually looks like:
stash@{0}: WIP on master: abc123 This is the message of some commit.
However, if git stash save 'a stash message'
is used, the commit does not appear in the stash list:
stash@{1}: On master: my own message
So how could it be retrieved?
回答1:
I'd say
git log -1 commitish^
E.g.
git log -1 stash@{0}^
Otherwise,
git log -g --no-walk --parents refs/stash
来源:https://stackoverflow.com/questions/16071720/get-git-stash-parent-commit