Last active
March 26, 2023 14:25
-
-
Save michael-go/81f258bffc56ee26e155d9b63faa0a93 to your computer and use it in GitHub Desktop.
alias to clone github repo to org/repo folder
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
github-clone(){org=$(echo $1 | sed -E 's/.*github\.com.([^/]*)\/.*/\1/') && repo=$(echo $1 | sed -E 's/.*github\.com.[^/]*\/(.*)\.git/\1/') && git clone $1 $org/$repo} | |
# Example usage: | |
# > github-clone [email protected]:microsoft/vscode.git | |
# or | |
# > github-clone https://github.com/microsoft/vscode.git | |
# | |
# both will clone into ./microsoft/vscode instead of just ./vscode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment