【发布时间】:2017-08-04 20:03:16
【问题描述】:
我正在尝试在 命令提示符 中运行以下命令,参数只有一个百分比,因为它应该用于命令提示符说明:
for /F %remote in ('git branch -a') do (git branch --track %remote) && git fetch --all && git pull --all
但我仍然收到以下错误:
%remote 此时出乎意料。
这种“此时的争论出乎意料”存在很多问题。我已经搜索过,但几乎所有解决方案都提到了使用 % 或 %% 之间的相同混淆。双倍百分比只能在批处理文件中使用。但我使用了正确的符号。为什么它不起作用?
可能是因为括号?我不知道this issue mentioned on Microsoft's website 是否相关。
【问题讨论】:
-
帮助文件第三行:
%variable Specifies a single letter replaceable parameter.
标签: batch-file windows-console