在不应用它的情况下查看存储中的内容

时间:2012-05-23 18:26:40

标签: git git-stash

  

可能重复:
  Is it possible to preview stash contents in git?

我看到here你可以申请/取消申请藏匿,甚至可以从藏匿处创建一个新的分支。是否有可能只是在没有实际应用它的情况下简单地看到藏匿内容是什么?

1 个答案:

答案 0 :(得分:2049)

来自man git-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).

列出隐藏的修改

git stash list

显示上次存储中更改的文件

git stash show

因此,要查看最近藏匿的内容,请运行

git stash show -p

要查看任意藏匿的内容,请运行类似

的内容
git stash show -p stash@{1}