git stash pop和git stash之间的区别适用 [英] Difference between git stash pop and git stash apply

查看:220
本文介绍了git stash pop和git stash之间的区别适用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 git stash pop 很长一段时间了。我最近发现了有关 git stash apply 命令。当我试用它时,它看起来和 git stash pop 一样。

git stash pop 和 git stash apply

解决方案

git stash pop (应用程序默认最高),然后 git stash apply 将其保留在存储列表中,以便稍后重新使用(或者你可以 git stash drop 它)。



除非 git stash pop 之后存在冲突,否则这种情况不会删除存储,其行为完全像 git stash apply 。



另一种查看方式: git stash pop git stash apply&& git stash drop


I've been using git stash pop for quite some time. I recently found out about the git stash apply command. When I tried it out, it seemed to work the same as git stash pop.

What is the difference between git stash pop and git stash apply?

解决方案

git stash pop throws away the (topmost, by default) stash after applying it, whereas git stash apply leaves it in the stash list for possible later reuse (or you can then git stash drop it).

This happens unless there are conflicts after git stash pop, in this case, it will not remove the stash, behaving exactly like git stash apply.

Another way to look at it: git stash pop is git stash apply && git stash drop.

这篇关于git stash pop和git stash之间的区别适用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆