有没有办法真正看到 git stash 各个级别中的变化?

有没有办法真正看到 git stash 各个级别中的变化?

假设我做了git stash几次,每次都有变化,我就能看到git stash show存储堆栈顶部的文件发生了哪些变化。我还可以看到我进行了多少次添加/删除。

然而,我不知道如何在git stash pop没有git diff

另外,我如何才能查看以前的更改文件(最好是查看全部更改,但查看文件也会有帮助)git stash

答案1

git stash show -p <STASH>

如果没有STASH给出,则会显示最近存储中的更改。来自man git-stash

   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). You can use stash.showStat and/or stash.showPatch
       config variables to change the default behavior.

相关内容