Git diff against a stash
How can I see the changes un-stashing will make to the current working tree? I would like to know what changes will be made before applying them!
See the most recent stash:
git stash show -p
See an arbitrary stash:
git stash show -p stash@{1}
From the git stash
manpages:
By default, the command shows the diffstat, but it will accept any format known to git diff (eg, git stash show -p stash@{1} to view the second most recent stash in patch form).
To see the most recent stash:
git stash show -p
To see an arbitrary stash:
git stash show -p stash@{1}
Also, I use git diff to compare the stash with any branch.
You can use:
git diff stash@{0} master
To see all changes compared to branch master.
Or You can use:
git diff --name-only stash@{0} master
To easy find only changed file names.
If the branch that your stashed changes are based on has changed in the meantime, this command may be useful:
git diff stash@{0}^!
This compares the stash against the commit it is based on.
链接地址: http://www.djcxy.com/p/57230.html上一篇: 如何从Git中的暂时更改中移除说明“旧模式100755新模式100644”的文件?
下一篇: Git diff与藏匿处