gpt4 book ai didi

git - 如何在 1.8.3 中 Git stash pop specific stash?

转载 作者:IT王子 更新时间:2023-10-29 01:15:08 28 4
gpt4 key购买 nike

我刚刚升级了 Git。我使用的是 Git 1.8.3 版。

今天早上,我试图取消 stash 堆栈深处的更改 1。

我运行了 git stash pop stash@{1} 并遇到了这个错误。

fatal: ambiguous argument 'stash@1': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]'

我已经尝试了大约 20 多种变体以及使用 apply 而不是 pop 但没有成功。有什么变化?还有其他人遇到过这种情况吗?

最佳答案

git stash apply n

从 git 版本 2.11 开始工作

原始答案,可能有助于调试涉及 shell 转义的旧语法的问题:

如前所述,大括号可能需要转义或引用,具体取决于您的操作系统、shell 等。

请参阅“stash@{1} is ambiguous?”,了解可能出错的一些详细提示,以及如何在各种 shell 和平台中解决它。

git stash list
git stash apply stash@{n}

git stash apply version

关于git - 如何在 1.8.3 中 Git stash pop specific stash?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17454235/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com