This file contains 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 |