[英]Git clone from bash script
I am trying to automate my interactions with Git building a script and I am having the following problem. 我正在尝试自动与构建脚本的Git交互,但遇到以下问题。
This works from the command line: 这可以从命令行使用:
git clone git@github.xxxx.com:blablabla/reponame.git /Users/myname/dev/myfolder
And now I would like to do the same, but from my script. 现在,我想执行同样的操作,但是要从我的脚本开始。 I have the following:
我有以下内容:
#/bin/bash
repository="git@github.xxxx.com:blablabla/reponame.git"
localFolder="/Users/myname/dev/myfolder"
git clone $repository" "$localFolder
that gives me this error 那给我这个错误
GitHub SSH access is temporarily unavailable (0x09).
暂时无法使用GitHub SSH访问(0x09)。 fatal: The remote end hung up unexpectedly
致命:远端意外挂断
Any light on this will be much appreciated 任何光对此将不胜感激
You mean git clone "$repository" "$localFolder"
, I'd hope? 您的意思是
git clone "$repository" "$localFolder"
,我希望吗?
Running git clone $repository" "$localFolder
is something quite different: 运行
git clone $repository" "$localFolder
完全不同:
$IFS
), they could become multiple arguments, and if they contained globs ( *
, [...]
, etc), those arguments could be replaced with filenames (or simply removed from the generated argument list, if the nullglob
shell option is enabled) $IFS
内的字符),则它们可能成为多个参数,并且如果它们包含glob( *
, [...]
等),则这些参数可以用文件名替换(或从中删除)生成的参数列表(如果启用了nullglob
shell选项) git
. git
之前将它们合并为一个参数。 So, for the values you gave, what this script runs would be: 因此,对于您提供的值,此脚本运行的内容是:
git clone "git@github.xxxx.com:blablabla/reponame.git /Users/myname/dev/myfolder"
...which is quite different from ...与
git clone git@github.xxxx.com:blablabla/reponame.git /Users/myname/dev/myfolder
...as it is giving the /Users/myname/dev/myfolder
path as part of the URL. ...因为它提供
/Users/myname/dev/myfolder
路径作为URL的一部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.