查看隐藏内容而不应用它[重复]

问题描述 投票:0回答:1

如何在不实际应用的情况下查看 stash 中的内容?

git git-stash
1个回答
3738
投票

来自

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
© www.soinside.com 2019 - 2024. All rights reserved.