Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法检索最初创建存储的提交?
使用默认命令创建存储时,git stash原始提交保存在存储消息中,因此通常如下所示:
git stash
stash@{0}: WIP on master: abc123 This is the message of some commit.
但是,如果git stash save 'a stash message'使用,则提交不会出现在存储列表中:
git stash save 'a stash message'
stash@{1}: On master: my own message
那么如何找回呢?
我会说
git log -1 commitish^
例如
git log -1 stash@{0}^
否则,
git log -g --no-walk --parents refs/stash