問題

假設我有2個被積壓的檔案:

 $ git stash show

a.txt | 2 +-
b.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
 

我可以檢視stash的完整差異:

 diff --git a/a.txt b/a.txt
index bc56c4d..a688182 100644
--- a/a.txt
+++ b/a.txt
@@ -1 +1 @@
-Foo
+Baz
diff --git a/b.txt b/b.txt
index ebd7525..4105321 100644
--- a/b.txt
+++ b/b.txt
@@ -1 +1 @@
-Bar
+Qux
 

更多檔案會雜亂輸出,所以我想只檢視1個特定檔案.但是,手冊似乎說沒有使用檔名引數的選項:

 NAME
       git-stash - Stash the changes in a dirty working directory away

SYNOPSIS
       ...
       git stash show [<stash>]
       ...
 

有沒有辦法只檢視1個特定的stabled檔案的diff內容?

  相同標籤的其他問題

gitdiffgit-stashgit-show