Skip to content


Quick Tip: Install hub for GitHub on Ubuntu

Yesterday I was automating updates between GitHub repos via CI, and I wanted to automatically open a PR against a repo. GitHub’s hub CLI is the perfect, obvious candidate. But how do you easily install it in Ubuntu?

A long “one-liner” to download and install a specific version of hub as a pre-compiled binary:


curl -Ls https://github.com/github/hub/releases/download/v2.11.1/hub-linux-amd64-2.11.1.tgz | sudo tar -xvz -C /usr/bin --strip-components=2 hub-linux-amd64-2.11.1/bin/hub && sudo chmod 755 /usr/bin/hub

If you don’t mind running a development version, and you have go installed, you can just run


go get github.com/github/hub

But you’ll need to add $GOPATH/bin to your $PATH to easily use it.

Posted in Tech Reference.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

 



Log in here!