2013-04-17 38 views
2

有沒有一種方法來檢索最初創建存儲的提交?獲取git存儲父提交

當創建與默認命令藏匿git stash原來提交保存在藏匿的消息,所以它通常是這樣的:

[email protected]{0}: WIP on master: abc123 This is the message of some commit. 

但是,如果git stash save 'a stash message'時,提交不會出現在存儲列表:

[email protected]{1}: On master: my own message 

那麼如何檢索?

回答

3

我想說

git log -1 commitish^ 

例如

git log -1 [email protected]{0}^ 

否則,

git log -g --no-walk --parents refs/stash 
+0

啊,從未想過'藏匿@ {X}的'作爲參考。完美的作品! – LopSae

+0

@LopSae雖然'refs/stash',它不是一個引用。正如你所看到的,儲存在一個「假分支refs/stash」上,並且單個項目可以作爲該假分支reflog中的項目。 – sehe