hub github helper

Nate Finch nate.finch at canonical.com
Tue Aug 2 16:08:02 UTC 2016


I've mentioned this before, but with some of our new code review
guidelines, I figured it's good to reiterate.  Github has a CLI tool that
helps with doing git-related things with github.  It's called hub. It's
written in Go, so installing it is as easy as go get github.com/github/hub

Github recommends making an alias to have hub replace git, since it
forwards everything to git that it doesn't understand.  Honestly, I don't
really see any benefit to that.  I prefer to understand what git is doing
versus what hub is doing.

It can do a whole bunch of stuff, but there are two things I use it for the
most - checking out PRs and making PRs.

Since we're supposed to be doing manual testing on people's PRs when we
review them, we need a way to do that.  With hub it's one command:

hub checkout <url of PR>

so, for example:

hub checkout https://github.com/juju/juju/pull/5915

Bam, your local branch is set to a copy of the PR (don't forget to run
godeps).

To make a PR from the CLI using hub, make sure the repo you want to PR
against is the git remote called origin, then you can make a PR with your
current branch by just doing

hub pull-request

This will open an editor to write the PR message, or you can use -m just
like with git commit.

-Nate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20160802/e5f6af73/attachment.html>


More information about the Juju-dev mailing list