小编典典

git stash pop 和 git stash apply 的区别

all

我已经使用git stash pop了一段时间。我最近发现了这个git stash apply命令。当我尝试它时,它似乎与git stash pop.

git stash pop和 和有什么不一样git stash apply


阅读 414

收藏
2022-02-25

共1个答案

小编典典

git stash pop 应用后丢弃 (默认情况下最顶层)存储,而git stash apply 将其保留在存储列表中
以供以后重用(或者您可以使用git stash drop它)。

除非 之后发生冲突,否则会发生这种情况git stash pop,在这种情况下,它不会删除存储,使其行为与git stash apply.

另一种看待它的方式:git stash popgit stash apply && git stash drop

2022-02-25