如何判断是否不再需要git stash? [英] How can you tell if a git stash is no longer required?
问题描述
是否可以不执行git stash apply
判断是否已应用存储,因此不再需要该存储?假设我只使用一个分支.
Is it possible to tell whether a stash has already been applied, and therefore is no longer required, without doing git stash apply
? Assume that I'm only using one branch.
在应用存储时可以通过使用pop
而不是apply
来防止这种情况,因此,每次应用存储时都应清除该存储.但是,有时我会使用git stash保留正在进行的工作的快照,而不是仅使用它来将一项任务切换到另一项任务.使用pop会在某种程度上击败它.
This could be prevented by using pop
rather than apply
when applying a stash, and therefore get rid of the stash each time it gets applied. However, I sometimes use git stash to keep a snapshot of work in progress, rather than only using it to switch from one task to another. Using pop would defeat that somewhat.
推荐答案
只需进行比较,您就会看到.
Just make a diff and you will see.
git diff HEAD stash @ {0}
git diff HEAD stash@{0}
这篇关于如何判断是否不再需要git stash?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!