[英]mac homebrew git command not found
When I run the following on a mac from the command line it works fine: 当我从命令行在Mac上运行以下命令时,它工作正常:
git submodule foreach "git checkout develop; git pull"
... but when I run it from within a .sh script it gives a git: command not found error: ...但是当我从.sh脚本中运行它时,它给出了git:命令未找到错误:
/usr/local/Cellar/git/2.14.2/libexec/git-core/git-submodule: line 355: “git: command not found
The full script is as follows. 完整脚本如下。 The checkout and pull work, but submodule foreach throws the error: 检出和提取工作,但是foreach子模块抛出错误:
#!/bin/bash
set -e
set -u
git checkout develop && git pull
git submodule foreach “git checkout develop; git pull”
exit 0
Advice I've found says to make sure usr/bin is in my path. 我发现的建议是要确保usr / bin在我的路径中。 But here's what I see when I do echo $PATH (seems to already be there): 但是,这是我回显$ PATH时看到的(似乎已经存在):
/Users/myusername/.nvm/versions/node/v8.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/VMware Fusion.app/Contents/Public
Your quotes are off. 您的报价已关闭。
It should be "git checkout develop; git pull"
instead of “git checkout develop; git pull”
应该是"git checkout develop; git pull"
而不是“git checkout develop; git pull”
“git checkout develop; git pull”
. “git checkout develop; git pull”
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.