我知道您可以使用git stash show stashID -p
查看对文件的更改,如果弹出特定存储的内容,则将应用这些更改。有没有办法只查看与一个特定文件的差异? git stash
的帮助部分说
By default, the command shows the diffstat, but it will accept any format known to git diff
但是git stash show stashID -p <filepath>
无效,因为<filepath>
似乎被视为另一个存储ID。
git show stash@{n} -- path/to/file
(这里-p
是多余的,因为它是默认行为)