如何在不实际应用的情况下查看 stash 中的内容?
来自
man git-stash
(也可以通过git help stash
获得):
可以使用
列出此命令隐藏的修改,使用git stash list
检查,以及 ...git stash show
show [<stash>]
Show the changes recorded in the stash as a diff between the stashed
state and its original parent. When no <stash> is given, shows the
latest one. By default, the command shows the diffstat, but it will
accept any format known to git diff (e.g., git stash show -p stash@{1}
to view the second most recent stash in patch form).
注意:
-p
选项会根据git-diff
文档生成补丁。
列出藏品:
git stash list
显示最近存储中的文件:
git stash show
显示最近存储的更改:
git stash show -p
显示指定存储的更改:
git stash show -p stash@{1}
或者简而言之:
git stash show -p 1
如果您只想查看最后一个存储的更改:
git stash show -p 0