+
Skip to content

bmaca/ghub

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 

Repository files navigation

ghub

A command line interface for github.

Requirements

  • Python 2.7 or greater
  • git

Introduction

ghub is a simple command line utility for facilitating common tasks with github. It uses the repository found in the current working directory to determine upstream and origin URLs. You can also use a single origin repo if you prefer.

More exhaustive tools exist (see http://hub.github.com for one example). This tool is intended to be simple, fast and have few dependencies.

This tool is a work in progress.

Getting Started

  1. Generate a personal access token from github.
  2. Store the access token in your gitconfig. This has potentially serious security implications. Only do this on a machine you trust:
    git config --global github.token <token value>
    
  3. Install ghub:
    git clone git@github.com:ccstolley/ghub
    
    cd ghub
    
    python ./setup.py install
    
  4. Create remote repositories for upstream and origin. Eg.:
    git remote add origin git@github.com:joesmith/ghub
    
    # optional
    git remote add upstream git@github.com:ccstolley/ghub
    
  5. Drink a beer.

Usage

usage: ghub [-h] [-i [number]] [-p [number]] [-d number] [-n base_branch]
            [-m number] [-c number] [-v]

command line interface to github

optional arguments:
  -h, --help            show this help message and exit
  -i [number], --showissue [number]
                        show issue #, or show all for specified user
  -p [number], --showpull [number]
                        show pull request # or show all
  -d number, --diff number
                        show diff for pull request #
  -n base_branch, --newpull base_branch
                        create a new pull request from the current branch to
                        base_branch
  -m number, --mergepull number
                        merge pull request #
  -c number, --comment number
                        post comment on issue #
  -v, --verbose         be verbose

Examples

Display a specific issue:

ghub -i 442

Post a comment to a specific issue:

ghub -c 442

List all open issues assigned to me in this repo:

ghub -i

List all unassigned open issues in this repo:

ghub -i none

List all open issues in this repo:

ghub -i '*'

List issues assigned to ccstolley, including comments and summary:

ghub -i ccstolley -v

Create a pull request from the current branch to the specific upstream branch:

ghub -n dev

Display pull request and comments:

ghub -p 101

Merge pull request:

ghub -m 101

Display pull request diff in color (requires cdiff):

ghub -d 101 | cdiff

About

A command line interface for github

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载