git + hub = github

Opening a new pull request from GitHub’s UI? Copy-pasting the SSH/HTTPS url for cloning a repo?

Ain’t nobody got time for that!

Ain't nobody got time for that!

hub is a command-line wrapper for git that makes you better at GitHub.

Usage

I’ve been using it for a while now and this is the gist:

  • Create a new PR from your current branch:
$ hub pull-request -o

Will open your default editor to insert the header and description, then launch a new browser tab to view it. You can even add reviewers [-r <REVIEWERS>]

  • Clone a GitHub repo:
$ hub clone github/hub

Expands to git@github.com:github/hub.git Just replace ‘github’ with the repo’s organization or user and ‘hub’ with its name.

Protip

As the docs suggest, hub is best aliased as git. So feel free to add it to your .bashrc/.zshrc: alias git=hub

Installation

Follow the instruction and other examples here

The manual can be found here

comments powered by Disqus