-
-
Save XavierChanth/fcc124500290917108d81fcda20382ac to your computer and use it in GitHub Desktop.
GitHub clone command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clone () { | |
REPO=$1 | |
shift | |
if [[ $REPO =~ ^(git@github\.com:.*|https:\/\/github\.com\/.*)$ ]] | |
then | |
prefix="" | |
else | |
prefix="[email protected]:" | |
fi | |
git clone "$prefix$REPO" "$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this to ~/.zshrc or ~/.bashrc