Reputation: 167
I am trying to automate my interactions with Git building a script and I am having the following problem.
This works from the command line:
git clone [email protected]: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="[email protected]:blablabla/reponame.git"
localFolder="/Users/myname/dev/myfolder"
git clone $repository" "$localFolder
that gives me this error
GitHub SSH access is temporarily unavailable (0x09). fatal: The remote end hung up unexpectedly
Any light on this will be much appreciated
Upvotes: 14
Views: 84792
Reputation: 9
I had the same problem in my case I want to clone all of my GitHub repos (all branches) to backup it in folder. I created a python script to do it located here https://github.com/tisma95/github-clone you can try with it if you want.
Thanks
Upvotes: -1
Reputation: 295288
You mean git clone "$repository" "$localFolder"
, I'd hope?
Running git clone $repository" "$localFolder
is something quite different:
$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)git
.So, for the values you gave, what this script runs would be:
git clone "[email protected]:blablabla/reponame.git /Users/myname/dev/myfolder"
...which is quite different from
git clone [email protected]:blablabla/reponame.git /Users/myname/dev/myfolder
...as it is giving the /Users/myname/dev/myfolder
path as part of the URL.
Upvotes: 25