Last Updated: February 25, 2016
·
591
· reorx

Command: github-clone

Cloning code from github is a frequent action for us, it's boring to type git clone git@github.com:someone/somerepo, or copy & paste the url from the project page. So I make a simple function in my .zshrc:

function github-clone() {
    git clone git@github.com:$1.git $2
}

Now you just need to type github-clone someone/repo to clone, quick and easy!

1 Response
Add your response

There are 2 ways to do it better:

  • use address alias (add this to .gitconfig and then use it git clone gh:name/repo):

    [url "git@github.com"]
      insteadOf = gh
  • use Hub

over 1 year ago ·