Add support for cloning a branch by using a URL fragment. (No tag support... yet.)
This commit is contained in:
parent
44b7f60163
commit
2e5d80c63d
1 changed files with 13 additions and 2 deletions
15
bin/get
15
bin/get
|
|
@ -272,8 +272,19 @@ then
|
||||||
else
|
else
|
||||||
url="$2"
|
url="$2"
|
||||||
fi
|
fi
|
||||||
echo Cloning $url
|
|
||||||
git clone --recurse-submodules "$url"
|
# Extract branch from URL
|
||||||
|
if [[ "$url" == *"#"* ]]
|
||||||
|
then
|
||||||
|
clone_branch=${url##*#}
|
||||||
|
url=${url%#*}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Default to master branch if no branch in URL
|
||||||
|
clone_branch=${clone_branch:-master}
|
||||||
|
|
||||||
|
echo "Cloning $clone_branch branch of $url"
|
||||||
|
git clone --recurse-submodules -b $clone_branch "$url"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
squash)
|
squash)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue