Skip to content

Instantly share code, notes, and snippets.

@LeopoldLabs
Last active April 25, 2025 13:44
Show Gist options
  • Save LeopoldLabs/369ad8363253d7b75476b66f2395c07b to your computer and use it in GitHub Desktop.
Save LeopoldLabs/369ad8363253d7b75476b66f2395c07b to your computer and use it in GitHub Desktop.
bash git clone command shortcut
clone () {
if [ -z "$1" ]; then
echo "Usage: clone <username> <repository> OR clone <repository> after setting up the default username"
return 1
fi
username="$1"
if [ -z "$2" ]; then
username="simulationguest"
repo="$1"
else
repo="$2"
fi
mkdir -p ~/Developer/$username
cd ~/Developer/$username
git clone [email protected]:$username/$repo.git
cd ./$repo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment