Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

git-stashの内容を確認する

素のgit-stash-showならば

git stash show
 spec/hoge.feature |  3 ++-
 spec/fuga.feature  | 12 ++----------
 spec/steps/page_steps.rb                   |  4 ++--
 3 files changed, 6 insertions(+), 13 deletions(-)

と差分を見る事ができます。
pオプションをつけると

$ git stash show -p
diff --git a/spec/hoge.feature b/spec/hoge.feature
index 3468e55..553cbe6 100644
--- a/spec/hoge.feature
+++ b/spec/hoge.feature

...

と、git log -pっぽい感じでファイルの具体的差分を見る事ができます。

個別のファイル差分を確認したい場合は、git-diffとの合わせ技で

$ git diff HEAD..stash@{0} FILENAME

とします。
stash@{0}というのは最新版stashの名前なので、別のものを指定したい場合は

$ git stash list

で積んでるstashを確認しましょう。