Skip to content

Instantly share code, notes, and snippets.

@XavierChanth
Created February 9, 2023 19:42
Show Gist options
  • Save XavierChanth/fcc124500290917108d81fcda20382ac to your computer and use it in GitHub Desktop.
Save XavierChanth/fcc124500290917108d81fcda20382ac to your computer and use it in GitHub Desktop.
GitHub clone command
clone () {
REPO=$1
shift
if [[ $REPO =~ ^(git@github\.com:.*|https:\/\/github\.com\/.*)$ ]]
then
prefix=""
else
prefix="[email protected]:"
fi
git clone "$prefix$REPO" "$@"
}
@XavierChanth
Copy link
Author

Add this to ~/.zshrc or ~/.bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment