• Stars
    star
    1,123
  • Rank 41,432 (Top 0.9 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 16 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

`github` command line helper for simplifying your GitHub experience.

The GitHub Gem

This gem works hand-in-hand with GitHub's API to help you out.

Catch us in the #github room on freenode if you want to get involved. Or just fork and send a pull request.

Getting started

$ gem install github

Run it:

$ github <command> <args>
$ gh <command> <args>

Requirements

Only installs pure JSON gem json_pure by default. If you are able to install the C-extension json gem, it will use that instead.

Try:

gem install json github

Pulling Upstream Changes

Let's say you just forked github-gem on GitHub from defunkt.

$ gh clone YOU/github-gem
$ cd github-gem
$ gh pull defunkt

This will setup a remote and branch for defunkt's repository at master. In this case, a 'defunkt/master' branch.

If defunkt makes some changes you want, simply github pull defunkt. This will leave you in the 'defunkt/master' branch after pulling changes from defunkt's remote. After confirming that defunkt's changes were what you wanted, run git checkout master and then git merge defunkt/master to merge defunkt's changes into your own master branch. In summary:

$ gh pull defunkt
$ gh checkout master
$ gh merge defunkt/master

If you've already reviewed defunkt's changes and just want to merge them into your master branch, use the merge flag:

$ gh pull --merge defunkt

Fetching and Evaluating Downstream Changes

If you are the maintainer of a project, you will often need to fetch commits from other developers, evaluate and/or test them, then merge them into the project.

Let's say you are 'defunkt' and 'mojombo' has forked your 'github-gem' repo, made some changes and issues you a pull request for his 'master' branch.

From the root of the project, you can do:

$ gh fetch mojombo master

This will leave you in the 'mojombo/master' branch after fetching his commits. Your local 'mojombo/master' branch is now at the exact same place as mojombo's 'master' branch. You can now run tests or evaluate the code for awesomeness.

If mojombo's changes are good, you'll want to merge your 'master' (or another branch) into those changes so you can retest post-integration:

$ gh merge master

Test/analyze again and if everything is ok:

$ gh checkout master
$ gh merge mojombo/master

The latter command will be a fast-forward merge since you already did the real merge previously.

Network Patch Queue

The github gem can also show you all of the commits that exist on any fork of your project (your network) that you don't have in your branch yet. In order to see the list of the projects that have commits you do not, you can run:

$ gh network list

Which will show you all the forks that have changes. If you want to see what those changes are, you can run:

$ gh network commits

which will show you something like this:

9582b9 (jchris/gist)             [email protected]          Add gist binary                        4 months ago
c1a6f9 (jchris/gist~1)           [email protected]          Tweak Rakefile spec tasks to be a bi   4 months ago
d3c332 (jchris/gist~2)           [email protected]          Pull out two helpers into the shared   4 months ago
8f65ab (jchris/gist~3)           [email protected]          Extract command/helper spec assistan   4 months ago
389dbf (jchris/gist~4)           [email protected]          Rename ui_spec to command_spec         4 months ago
670a1a (jchris/gist~5)           [email protected]          Hoist the specs into a per-binary sp   4 months ago
6aa18e (jchris/gist~6)           [email protected]          Hoist commands/helpers into a per-co   4 months ago
ee013a (luislavena/master)       [email protected]  Replaced STDOUT by $stdout in specs.   2 weeks ago
d543c4 (luislavena/master~3)     [email protected]  Exclude package folder.                8 weeks ago
a8c3eb (luislavena/master~5)     [email protected]  Fixed specs for open under Windows.    5 months ago
33d003 (riquedafreak/master)     enrique.osuna@gmail.  Make sure it exists on the remote an   5 weeks ago
157155 (riquedafreak/master~1)   enrique.osuna@gmail.  Updated specs.                         5 weeks ago
f44e99 (riquedafreak/master~3)   enrique.osuna@gmail.  Only work with a clean branch.         3 months ago

These are all the commits that you don't have in your current branch that have been pushed to other forks of your project. If you want to incorporate them, you can use:

$ gh cherry-pick ee013a

for example to apply that single patch to your branch. You can also merge a branch, if you want all the changes introduced in another branch:

$ gh merge jchris/gist

The next time you run the 'github network commits' command, you won't see any of the patches you have cherry-picked or merged (or rebased). If you want to ignore a commit, you can simply run:

$ gh ignore a8c3eb

Then you won't ever see that commit again. Or, if you want to ignore a range of commits, you can use the normal Git revision selection shorthands - for example, if you want to ignore all 7 jchris/gist commits there, you can run:

$ gh ignore ..jchris/gist

You can also filter the output, if you want to see some subset. You can filter by project, author and date range, or (one of the cooler things) you can filter by whether the patch applies cleanly to your branch head or not. For instance, I can do this:

$ ./bin/github network commits --applies

ca15af (jchris/master~1)         [email protected]       fixed github gemspecs broken referen   8 weeks ago
ee013a (luislavena/master)       [email protected]  Replaced STDOUT by $stdout in specs.   2 weeks ago
157155 (riquedafreak/master~1)   enrique.osuna@gmail.  Updated specs.                         5 weeks ago
f44e99 (riquedafreak/master~3)   enrique.osuna@gmail.  Only work with a clean branch.         3 months ago

$ ./bin/github network commits --applies --project=riq

157155 (riquedafreak/master~1)   enrique.osuna@gmail.  Updated specs.                         5 weeks ago
f44e99 (riquedafreak/master~3)   enrique.osuna@gmail.  Only work with a clean branch.         3 months ago

Pretty freaking sweet. Also, you can supply the --shas option to just get a list of the shas instead of the pretty printout here, so you can pipe that into other scripts (like 'github ignore' for instance).

Issues

If you'd like to see a summary of the open issues on your project:

$ gh issues open

-----
Issue #135 (2 votes): Remove Node#collect_namespaces
*  URL: http://github.com/tenderlove/nokogiri/issues/#issue/135
*  Opened 3 days ago by tenderlove
*  Last updated about 1 hour ago

I think we should remove Node#collect_namespaces.  Since namespace names are not unique, I don't know that this method is very useful.
-----
Issue #51 (0 votes): FFI: support varargs in error/exception callbacks
*  URL: http://github.com/tenderlove/nokogiri/issues/#issue/51
*  Opened 4 months ago by flavorjones
*  Last updated about 1 month ago
*  Labels: ffi, mdalessio

we should open JIRA tickets for vararg support in FFI callbacks

then we should format the libxml error messages properly in the error/exception callbacks
-----

If you want to additionally filter by time:

$ gh issues open --after=2009-09-14

Or filter by label:

$ gh issues open --label=ffi

Contributors

  • defunkt
  • maddox
  • halorgium
  • kballard
  • mojombo
  • schacon
  • drnic

More Repositories

1

jquery-pjax

pushState + ajax = pjax
JavaScript
16,740
star
2

gist

Potentially the best command line gister.
Ruby
3,805
star
3

dotjs

~/.js
Ruby
3,161
star
4

facebox

Facebook-style lightbox, built in jQuery
JavaScript
1,928
star
5

unicorn

Unofficial Unicorn Mirror.
Ruby
1,410
star
6

pystache

Mustache in Python
Python
1,308
star
7

cijoe

CI Joe is a fun Continuous Integration server. Unmaintained.
Ruby
1,046
star
8

coffee-mode

Emacs Major Mode for CoffeeScript
Emacs Lisp
574
star
9

gist.el

Yet another Emacs paste mode, this one for Gist.
Emacs Lisp
548
star
10

hurl

Hurl makes HTTP requests.
JavaScript
529
star
11

rip

Take back your $LOAD_PATH. Deprecated and unmaintained.
Ruby
363
star
12

repl

Sometimes you need a REPL. Unmaintained, sorry.
Ruby
360
star
13

textmate.el

Basic emulation of awesome TextMate features for Emacs.
Emacs Lisp
356
star
14

colored

Colors in your terminal. Unmaintained.
Ruby
270
star
15

cache_fu

Ghost from Christmas past. Unmaintained.
Ruby
257
star
16

exception_logger

Unmaintained. Sorry.
Ruby
242
star
17

cheat

Cheating is fun!
Ruby
239
star
18

Zen

Distraction free writing for Atom.
CoffeeScript
193
star
19

emacs

My Emacs config
Emacs Lisp
187
star
20

choice

Choice is a gem for defining and parsing command line options with a friendly DSL.
Ruby
176
star
21

ambition

include Enumerable โ€” Unmaintained
Ruby
165
star
22

markdown-mode

Emacs Markdown mode
Emacs Lisp
155
star
23

lyndon

Lyndon wraps JavaScript in a loving MacRuby embrace. A fun hack that is no longer maintained.
Ruby
145
star
24

nginx_config_generator

Generates nginx config files from YAML.
Ruby
125
star
25

acts_as_textiled

Makes your models act as textiled.
Ruby
115
star
26

resque-lock

A Resque plugin for ensuring only one instance of your job is running at a time.
Ruby
113
star
27

mofo

Mofo was a fast and simple microformat parser, based on a concise DSL and Hpricot. No longer maintained.
JavaScript
91
star
28

gem-man

RubyGems plugin to view a gem's manpage.
Ruby
85
star
29

quake

The source code to Quake, one of the best games ever.
79
star
30

mustache-sinatra-example

An example of using Mustache in a Sinatra app.
Ruby
79
star
31

defunkt.github.com

My GitHub Page
HTML
78
star
32

sake

System wide Rake.
Ruby
76
star
33

starling

Ruby
74
star
34

resque

Moved to resque/resque
57
star
35

ircamp

IRC <-> Campfire Bridge
Python
54
star
36

evilbot

an evil bot that's definitely not for convore
CoffeeScript
50
star
37

jasper

Lispy JavaScript
JavaScript
40
star
38

gibberish

Dead simple Rails localization.
Ruby
37
star
39

Mustache.tmbundle

A little textmate bundle for defunkt/mustache
36
star
40

resque-web

Sinatra-based web UI for Resque
Ruby
30
star
41

ike

Rake in Io.
Io
28
star
42

mapreducerb

Simple map/reduce in Ruby
Ruby
26
star
43

sake-tasks

Your own personal sake tasks, ripe for sharing.
25
star
44

matzbot

matzbot is nice so we are nice
Ruby
22
star
45

mustache-syntax-highlighter

Syntax highlighting plugin for mustache.rb
Ruby
22
star
46

repl-completion

Completion files for repl(1)
22
star
47

sfruby-meetup-resque

My Resque presentation at the SF Ruby Meetup, January 2010
Ruby
21
star
48

ftpd.rb

A simple ftp daemon, written in Ruby. Do not use โ€” here for historical purposes.
Ruby
19
star
49

zippy

Zippy lilโ€™ zipcode lib.
Ruby
18
star
50

subtlety

Subtlety: SVN => RSS, hAtom => Atom
Ruby
16
star
51

ambitious_activerecord

Unmaintained Ambitious ActiveRecord adapter, for Ambition.
Ruby
15
star
52

cheat.el

Cheat Emacs mode
Emacs Lisp
15
star
53

fixture_scenarios_builder

Build your fixtures in Ruby.
Ruby
15
star
54

resque-cli

A command line program for talking to Resque.
15
star
55

iui

Import of the iui library
JavaScript
14
star
56

ambitious_activeldap

Ambition adapter for ActiveLdap
Ruby
13
star
57

dodgeball.github.com

yes
Ruby
12
star
58

ooc-markdown

A Discount binding for ooc
C
12
star
59

pinder

My fork of Pinder, the Campfire API for Python developers.
Python
10
star
60

sdoc-helpers

Simple helpers to make using sdoc easier.
Ruby
10
star
61

metaid

10
star
62

Markdown-problems

Public repository to submit markdown problems to github support
9
star
63

currency_converter

Objective-C
9
star
64

magit

Mirror of the Magit Emacs mode.
Emacs Lisp
8
star
65

burn

Sinatra => Campfire
7
star
66

my-awesome-framework

A simple demonstration of how to effectively use Git submodules.
7
star
67

repo-in-a-repo

7
star
68

sakerb

Sake repository served fresh by the guys at Barefoot.
Ruby
7
star
69

barefootexamples

Ruby
7
star
70

ozimodo

An ancient Ruby on Rails powered tumblelog.
7
star
71

electron-wordwrap

7
star
72

redis-namespace

Moved to resque/redis-namespace
6
star
73

rtimeout

Ruby
6
star
74

lacampfire

Logical Awesome Campfire userscript.
JavaScript
6
star
75

my-fun-repo

5
star
76

my-fantastic-plugin

A simple demonstration of how to effectively use Git submodules.
5
star
77

github-markup

Moved!
5
star