【发布时间】:2014-03-19 14:20:53
【问题描述】:
正如我在this post 中提到的,我一般递归升级我的 git 子模块如下:
git submodule foreach 'git fetch origin; git checkout $(git rev-parse --abbrev-ref HEAD); git reset --hard origin/$(git rev-parse --abbrev-ref HEAD); git submodule update --recursive; git clean -dfx'
从终端调用此命令时效果很好。现在我很难将它嵌入到 GNU make 中,就像在 this Makefile 的 upgrade 目标中一样。
如果我只是复制粘贴命令:
upgrade:
git submodule foreach 'git fetch origin; git checkout $(git rev-parse --abbrev-ref HEAD); git reset --hard origin/$(git rev-parse --abbrev-ref HEAD); git submodule update --recursive; git clean -dfx'
它不起作用:GNU make 尝试评估/解释 $(git ...) 部分,尽管存在简单的引号。到目前为止,我尝试了几次都没有成功($$\(git ...),定义逐字命令as explained here 等)。
你有什么建议吗?
【问题讨论】: