Created
December 30, 2018 06:51
-
-
Save liaoyw/c0bb22a49db9a9bce2b1a55276452700 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
function gitclone() { | |
cd ~/workspace | |
path=$1 | |
# remove http:// or https:// at the begining | |
path=${path#http://} | |
path=${path#https://} | |
# replace xx.com:/path/dir to xx.com/path/dir | |
path=${path//://} | |
path=${path#git@} | |
path=${path%.git} | |
https_proxy=http://localhost:60797 git clone $1 $path | |
} | |
gitclone $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment