<commit_before># g + h = github [![Build Status](https://drone.io/github.com/jingweno/gh/status.png)](https://drone.io/github.com/jingweno/gh/latest)

![gh](http://owenou.com/gh/images/gangnamtocat.png)

Fast GitHub command line client implemented in Go. Current version is [0.16.0](http://bit.ly/go-gh).

## Overview

gh is a command line client to GitHub. It's designed to run as fast as possible with easy installation across operating systems.
If you like gh, please also take a look at [hub](https://github.com/defunkt/hub). Hub is a reference implementation to gh.

## Motivation

**Fast** 

    $ time hub version > /dev/null
    hub version > /dev/null  0.03s user 0.01s system 93% cpu 0.047 total

    $ time gh version > /dev/null
    gh version > /dev/null  0.01s user 0.01s system 85% cpu 0.022 total

    $ time hub browse > /dev/null
    hub browse > /dev/null  0.07s user 0.04s system 87% cpu 0.130 total

    $ time gh browse > /dev/null
    gh browse > /dev/null  0.03s user 0.02s system 87% cpu 0.059 total

**Muti-platforms**

gh is fully implemented in the Go language and is designed to run across operating systems.

**Easy installation**

There're no pre-requirements to run gh. Download the [binary](http://bit.ly/go-gh) and go!

## Installation


### Homebrew

Installing on OSX is easiest with [Homebrew](https://github.com/mxcl/homebrew):

    $ brew install https://raw.github.com/jingweno/gh/master/homebrew/gh.rb

### Standalone

`gh` is easily installed as an executable.
Download the [compiled binary forms of gh](http://bit.ly/go-gh) for Darwin, Linux and Windows.

### Source

To compile gh from source, you need to have a [Go development environment](http://golang.org/doc/install), version 1.1 or better, and run:

    $ go get github.com/jingweno/gh

Note that `go get` will pull down sources from various VCS.
Please make sure you have git and hg installed.

## Upgrade

Since gh is under heavy development, I roll out new releases often.
Please take a look at the [built binaries](http://bit.ly/go-gh) for the latest built binaries.
I plan to implement automatic upgrade in the future.

### Homebrew

To upgrade gh on OSX with Homebrew, run:

    $ brew upgrade https://raw.github.com/jingweno/gh/master/homebrew/gh.rb

### Source

To upgrade gh from source, run:

    $ go get -u github.com/jingweno/gh

## Aliasing

It's best to use `gh` by aliasing it to `git`.
All git commands will still work with `gh` adding some sugar.

`gh alias` displays instructions for the current shell. With the `-s` flag,
it outputs a script suitable for `eval`.

You should place this command in your `.bash_profile` or other startup
script:

    eval "$(gh alias -s)"

For more details, run `gh help alias`.

## Usage

### gh help
    
    $ gh help
    [display help for all commands]
    $ gh help pull-request
    [display help for pull-request]

### gh init

    $ gh init -g
    > git init
    > git remote add origin <EMAIL>:YOUR_USER/REPO.git

### gh checkout

    $ gh checkout https://github.com/jingweno/gh/pull/35
    > git remote add -f -t feature git://github:com/foo/gh.git
    > git checkout --track -B foo-feature foo/feature

    $ gh checkout https://github.com/jingweno/gh/pull/35 custom-branch-name

### gh merge

    $ gh merge https://github.com/jingweno/gh/pull/73
    > git fetch git://github.com/jingweno/gh.git +refs/heads/feature:refs/remotes/jingweno/feature
    > git merge jingweno/feature --no-ff -m 'Merge pull request #73 from jingweno/feature...'

### gh clone

    $ gh clone jingweno/gh
    > git clone git://github.com/jingweno/gh

    $ gh clone -p jingweno/gh
    > git clone <EMAIL>:jingweno/gh.git<commit_msg>Update README for gh push<commit_after># g + h = github [![Build Status](https://drone.io/github.com/jingweno/gh/status.png)](https://drone.io/github.com/jingweno/gh/latest)

![gh](http://owenou.com/gh/images/gangnamtocat.png)

Fast GitHub command line client implemented in Go. Current version is [0.16.0](http://bit.ly/go-gh).

## Overview

gh is a command line client to GitHub. It's designed to run as fast as possible with easy installation across operating systems.
If you like gh, please also take a look at [hub](https://github.com/defunkt/hub). Hub is a reference implementation to gh.

## Motivation

**Fast** 

    $ time hub version > /dev/null
    hub version > /dev/null  0.03s user 0.01s system 93% cpu 0.047 total

    $ time gh version > /dev/null
    gh version > /dev/null  0.01s user 0.01s system 85% cpu 0.022 total

    $ time hub browse > /dev/null
    hub browse > /dev/null  0.07s user 0.04s system 87% cpu 0.130 total

    $ time gh browse > /dev/null
    gh browse > /dev/null  0.03s user 0.02s system 87% cpu 0.059 total

**Muti-platforms**

gh is fully implemented in the Go language and is designed to run across operating systems.

**Easy installation**

There're no pre-requirements to run gh. Download the [binary](http://bit.ly/go-gh) and go!

## Installation


### Homebrew

Installing on OSX is easiest with [Homebrew](https://github.com/mxcl/homebrew):

    $ brew install https://raw.github.com/jingweno/gh/master/homebrew/gh.rb

### Standalone

`gh` is easily installed as an executable.
Download the [compiled binary forms of gh](http://bit.ly/go-gh) for Darwin, Linux and Windows.

### Source

To compile gh from source, you need to have a [Go development environment](http://golang.org/doc/install), version 1.1 or better, and run:

    $ go get github.com/jingweno/gh

Note that `go get` will pull down sources from various VCS.
Please make sure you have git and hg installed.

## Upgrade

Since gh is under heavy development, I roll out new releases often.
Please take a look at the [built binaries](http://bit.ly/go-gh) for the latest built binaries.
I plan to implement automatic upgrade in the future.

### Homebrew

To upgrade gh on OSX with Homebrew, run:

    $ brew upgrade https://raw.github.com/jingweno/gh/master/homebrew/gh.rb

### Source

To upgrade gh from source, run:

    $ go get -u github.com/jingweno/gh

## Aliasing

It's best to use `gh` by aliasing it to `git`.
All git commands will still work with `gh` adding some sugar.

`gh alias` displays instructions for the current shell. With the `-s` flag,
it outputs a script suitable for `eval`.

You should place this command in your `.bash_profile` or other startup
script:

    eval "$(gh alias -s)"

For more details, run `gh help alias`.

## Usage

### gh help
    
    $ gh help
    [display help for all commands]
    $ gh help pull-request
    [display help for pull-request]

### gh init

    $ gh init -g
    > git init
    > git remote add origin <EMAIL>:YOUR_USER/REPO.git

### gh push

    $ gh push origin,staging,qa bert_timeout
    > git push origin bert_timeout
    > git push staging bert_timeout
    > git push qa bert_timeout

    $ gh push origin
    > git push origin HEAD

### gh checkout

    $ gh checkout https://github.com/jingweno/gh/pull/35
    > git remote add -f -t feature git://github:com/foo/gh.git
    > git checkout --track -B foo-feature foo/feature

    $ gh checkout https://github.com/jingweno/gh/pull/35 custom-branch-name

### gh merge

    $ gh merge https://github.com/jingweno/gh/pull/73
    > git fetch git://github.com/jingweno/gh.git +refs/heads/feature:refs/remotes/jingweno/feature
    > git merge jingweno/feature --no-ff -m 'Merge pull request #73 from jingweno/feature...'

### gh clone

    $ gh clone jingweno/gh
    > git clone git://github.com/jingweno/gh

    $ gh clone -p jingweno/gh
    > git clone <EMAIL>:jingweno/gh.git
{'fraction_non_alphanumeric': 0.11456131078224102, 'fraction_numerical': 0.01638477801268499, 'mean_word_length': 3.1451259583789706, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 43, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '432411', 'n_tokens_mistral': 2658, 'n_tokens_neox': 2423, 'n_words': 898}