A command-line tool that makes git easier to use with GitHub.
Перейти к файлу
Chris Wanstrath e965b34374 more explanation 2009-12-08 02:44:01 -08:00
bin normal gem file structure 2009-12-08 00:45:46 -08:00
lib more explanation 2009-12-08 02:44:01 -08:00
test add -s flag to install 2009-12-08 02:42:07 -08:00
.kick add kicker task and test task 2009-12-07 22:28:03 -08:00
LICENSE MIT 2009-12-08 02:13:06 -08:00
README.md readme / install tweaks 2009-12-08 02:12:29 -08:00
Rakefile readme / install tweaks 2009-12-08 02:12:29 -08:00

README.md

hub: git + hub = github

hub is a command line utility which injects git with GitHub knowledge.

It can used on its own or can serve as a complete, backwards compatible replacement for the git script.

Normal:

$ hub clone rtomayko/tilt
Initialized empty Git repository in /Users/chris/sandbox/tilt/.git/
remote: Counting objects: 307, done.
remote: Compressing objects: 100% (219/219), done.
remote: Total 307 (delta 175), reused 85 (delta 45)
Receiving objects: 100% (307/307), 48.91 KiB, done.
Resolving deltas: 100% (175/175), done.

Aliased:

$ git clone rack/rack
Initialized empty Git repository in /Users/chris/sandbox/rack/.git/
remote: Counting objects: 4005, done.
remote: Compressing objects: 100% (1738/1738), done.
remote: Total 4005 (delta 2505), reused 3620 (delta 2208)
Receiving objects: 100% (4005/4005), 785.82 KiB | 129 KiB/s, done.
Resolving deltas: 100% (2505/2505), done.

Install

hub can be installed most easily as a stand alone script:

curl http://defunkt.github.com/hub/standalone > ~/bin/hub && chmod 0755 !$

It also can be installed using Rubygems:

$ gem install hub -s http://gemcutter.org/

Or from source:

$ git clone git://github.com/defunkt/hub.git
$ cd hub
$ rake setup

Once you've installed hub, you can invoke it directly from the command line:

$ hub version

To get the full experience, alias your git command to run hub by placing the following in your .bash_profile (or relevant startup script):

alias git=hub

Typing hub install <shell> will display install instructions for you shell.

Note that if you're running hub under Rubygems, it may be slow. Installing the standalone script is the fastest (and recommended) method.

Commands

git clone

$ git clone schacon/ticgit
> git clone git://github.com/schacon/ticgit.git

$ git clone -p schacon/ticgit
> git clone git@github.com:schacon/ticgit.git

git remote add

$ git remote add rtomayko
> git remote add rtomayko git://github.com/rtomayko/CURRENT_REPO.git

$ git remote add -p pjhyett
> git remote add rtomayko git@github.com:rtomayko/CURRENT_REPO.git

git init

$ git init -g
> git init
> git remote add origin git@github.com:USER/REPO.git

git help

$ git help
> (improved git help)

Prior Art

These projects also aim to either improve git or make interacting with GitHub simpler:

Contributing

Once you've made your great commits:

  1. Fork hub
  2. Create a topic branch - git checkout -b my_branch
  3. Push to your branch - git push origin my_branch
  4. Create an Issue with a link to your branch
  5. That's it!

Meta

Author

Chris Wanstrath :: chris@ozmm.org :: @defunkt