看来,当我执行 git stash apply 时,我需要输入 git stash drop 以便从可用的存储中删除该存储。我可以在一个命令中执行此操作吗?

最佳答案

git stash pop 就是你要找的。正如 man page 所说:

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.

关于git - 如何在同一命令中应用和删除我最新的 git stash?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11351756/

10-14 18:40