You can add the gcd
script to your local bin path or you can add the followin snippet to your bash .profile
or zsh .zshrc
file.
function gcd {
REPO=$1
CLONEPATH=$2
if [ -z $CLONEPATH ]; then
CLONEPATH=${$(basename $1)/.git/}
fi
git clone $REPO $CLONEPATH
cd $CLONEPATH
}
gcd https://github.com/laravel/laravel.git
(git clone https://github.com/laravel/laravel.git && cd laravel
)
gcd https://github.com/laravel/laravel.git phpthebestway
(git clone https://github.com/laravel/laravel.git phpthebestway && cd phpthebestway
)