You mean git clone "$repository" "$localFolder" , I hope?
Running git clone $repository" "$localFolder is something else entirely:
- Since none of the variables are in double quotation marks, their contents are separated by lines and extends glob; Thus, if they contained spaces (usually characters inside
$IFS ), they could become several arguments, and if they contained globes ( * , [...] etc.), these arguments could be replaced file names (or simply removed from the list of generated arguments if the nullglob shell option is nullglob ) - Since the space between the two arguments is quoted, they are combined into one argument before passing
git .
So, for the values you specified, this script will be executed:
git clone " git@github.xxxx.com :blablabla/reponame.git /Users/myname/dev/myfolder"
... which is very different from
git clone git@github.xxxx.com :blablabla/reponame.git /Users/myname/dev/myfolder
... because it passes the path /Users/myname/dev/myfolder as part of the URL.
Charles Duffy
source share