git clone $url || true git clone $url || true will cause shell startup with set -e fail with a git clone error.
If this is not what you want, then the proposed solutions with explicit testing for an existing target directory should work.
The only problem with them is that you will need to mimic the Git approach to determine its name.
Something like this should work:
url=git://host/path/name.git last=${url##*/} bare=${last%%.git} test -e "$bare" || git clone "$url"
These " ## and %% " tricks are standard features of the "parameter extension" POSIX shell rules .
source share