Clone Go projects to a clean GOPATH and start hacking right away.
Alternatives To Goclone
Select To Compare



goclone(1) demo screencast

goclone is a tool to clone Go repositories from GitHub and other sources to a clean $GOPATH and start working on them right away. No more turning your ~/go into a hot mess.


Clone ahmetb/govvv from GitHub, and start a new shell:

$ goclone ahmetb/govvv

Clone k8s.io/kubernetes and run cat LICENSE in its directory.

$ goclone k8s.io/kubernetes -- cat LICENSE

Clone https://github.com/rakyll/gops and set GOPATH/PWD in the current shell:

$ eval $(goclone -q https://github.com/rakyll/gops)


  • Creates clean GOPATH for each project, no more dependency version conflicts!
  • Supports hub(1) tool if present. This allows cloning of private repositories.
  • Supports various formats for cloning repositories:
    • ahmetb/govvv: GitHub repo name
    • [email protected]:user/repo.git: GitHub SSH format (works w/ private repos)
    • https://github.com/rakyll/hey: GitHub URL, pasted from web browser
    • gopkg.in/mgo.v2: Go import path, does not have to be GitHub
  • Spawns a new shell with GOPATH/PWD correctly set.
  • $GOPATH/bin is added to your $PATH automatically. This makes go install easier to use.


Download goclone file to your /usr/local/bin and chmod +x it.

One-line install script for macOS/Linux:

sudo wget -qO/usr/local/bin/goclone \
      https://rawgit.com/ahmetb/goclone/master/goclone && \
    sudo chmod +x /usr/local/bin/goclone

Brought to you by @ahmetb.

Popular Security Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.