Answer the question
In order to leave comments, you need to log in
How to do git clone in bash script if repository path contains spaces?
like this - everything works
git clone '/f/Folder name with spaces/' $1 && echo "ok"
gitFolder="/f/Folder name with spaces/";
git clone $gitFolder $1 && echo "ok"
Answer the question
In order to leave comments, you need to log in
Read about quoting and escaping and
correctly add quotes to the gitFolder variable.
Wangyu, that's like this:
gitFolder="\"/f/Folder name with spaces/\"";
git clone $gitFolder $1 && echo "ok"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question