如何在同一个命令中应用和删除最新的git存储?
似乎在执行git stash apply时,需要输入git stash drop,以便从可用的stash中删除该stash。我可以在一个命令中完成此操作吗?如何在同一个命令中应用和删除最新的git存储?,git,Git,似乎在执行git stash apply时,需要输入git stash drop,以便从可用的stash中删除该stash。我可以在一个命令中完成此操作吗?git stash pop是您需要的。正如政府所说: pop[--index][q |--quiet][] 从隐藏列表中删除单个隐藏状态并将其应用于 当前工作树状态的顶部,即执行反向操作 吉特的藏匿保存。工作目录必须与索引匹配。 应用状态可能会因冲突而失败;在这种情况下,情况并非如此 从隐藏列表中删除。您需要手动解决冲突 然后手动调用git
git stash pop
是您需要的。正如政府所说:
pop[--index][q |--quiet][]
从隐藏列表中删除单个隐藏状态并将其应用于
当前工作树状态的顶部,即执行反向操作
吉特的藏匿保存。工作目录必须与索引匹配。
应用状态可能会因冲突而失败;在这种情况下,情况并非如此
从隐藏列表中删除。您需要手动解决冲突
然后手动调用git stash drop。
请注意,如果出现合并冲突,在解决冲突后,您仍然必须手动删除
隐藏。
pop [--index] [-q|--quiet] [<stash>]
Remove a single stashed state from the stash list and apply it on
top of the current working tree state, i.e., do the inverse operation
of git stash save. The working directory must match the index.
Applying the state can fail with conflicts; in this case, it is not
removed from the stash list. You need to resolve the conflicts by hand
and call git stash drop manually afterwards.