git 在不应用的情况下查看存储中的内容
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10725729/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
See what's in a stash without applying it
提问by Chris Abrams
回答by simont
From the man git-stash
page:
从man git-stash
页面:
The modifications stashed away by this command can be listed with git stash list, inspected with git stash show
这个命令隐藏的修改可以用 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).
To list the stashed modifications
列出隐藏的修改
git stash list
git stash list
To show files changed in the last stash
显示上次存储中更改的文件
git stash show
git stash show
So, to view the content of the most recent stash, run
因此,要查看最新存储的内容,请运行
git stash show -p
To view the content of an arbitrary stash, run something like
要查看任意存储的内容,请运行类似
git stash show -p stash@{1}