如何git stash显示仅对一个文件的更改?

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

我知道您可以使用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 diff
1个回答
0
投票
git show stash@{n} -- path/to/file

(这里-p是多余的,因为它是默认行为)

© www.soinside.com 2019 - 2024. All rights reserved.