12

使用命令应用 git stash 时:

git stash apply stash@{1}

正如git stash 文档中所建议的那样。

我收到错误:

unknown option: -encodedCommand error
4

2 回答 2

22

我没有意识到的...

我在 powershell 中(使用posh-git),当然 {} 表示 powershell 代码。

因此,围绕 '' 将确保 powershell 将其解释为字符串。

git stash apply 'stash@{1}'

值得注意的是 posh-git 在按下 tab 时会自动完成名称(这让我意识到我的错误)。

于 2018-06-15T09:47:09.530 回答
1

把它放在这里进行谷歌搜索:

如果您将Windows 运行程序GitHub Actions一起使用并且错过$了表达式中的${{ github.ref }}.


在这种情况下,特别令人困惑的是,错误将与输出交错,使其看起来来自您正在调用的任何内容。例如在我的情况下:

Run iscc.exe InstallCreation\inno\service.iss /DMyAppVersion={{ github.ref }}
  iscc.exe InstallCreation\inno\service.iss /DMyAppVersion={{ github.ref }}
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
Unknown option: -encodedCommand
Inno Setup 6 Command-Line Compiler

⬆️-encodedCommand无关Inno Setup 6。_

于 2021-01-28T20:50:24.210 回答