1. hub(1)
  2. Git Manual
  3. hub(1)

NAME

hub - git + hub = github

SYNOPSIS

hub COMMAND OPTIONS
hub alias [-s] SHELL

git init -g OPTIONS
git create [-p] [-d <DESCRIPTION>] [-h <HOMEPAGE>]
git clone [-p] OPTIONS [USER/]REPOSITORY DIRECTORY
git remote add [-p] OPTIONS USER[/REPOSITORY]
git remote set-url [-p] OPTIONS REMOTE-NAME USER[/REPOSITORY]
git fetch USER-1,[USER-2,...]
git cherry-pick GITHUB-REF
git am GITHUB-URL
git push REMOTE-1,REMOTE-2,...,REMOTE-N REF
git browse [-u] [[USER/]REPOSITORY] [SUBPAGE]
git compare [-u] [USER] [START...]END
git submodule add [-p] OPTIONS [USER/]REPOSITORY DIRECTORY
git fork [--no-remote]

DESCRIPTION

hub enhances various git commands with GitHub remote expansion. The alias command displays information on configuring your environment:

CONFIGURATION

Use git-config(1) to display the currently configured GitHub username:

$ git config --global github.user

Or, set the GitHub username and token with:

$ git config --global github.user <username>
$ git config --global github.token <token>

See http://github.com/guides/local-github-config for more information.

You can also tell hub to use http:// rather than git:// when cloning:

$ git config --global --bool hub.http-clone true

Want to use environment variables instead of a local gitconfig for authentication?

EXAMPLES

git clone

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

$ git clone -p schacon/ticgit
> git clone [email protected]:schacon/ticgit.git

$ git clone resque
> git clone git://github.com/YOUR_USER/resque.git

$ git clone -p resque
> git clone [email protected]:YOUR_USER/resque.git

git remote add

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

$ git remote add -p rtomayko
> git remote add rtomayko [email protected]:rtomayko/CURRENT_REPO.git

$ git remote add origin
> git remote add origin git://github.com/YOUR_USER/CURRENT_REPO.git

git fetch

$ git fetch mislav
> git remote add mislav git://github.com/mislav/REPO.git
> git fetch mislav

$ git fetch mislav,xoebus
> git remote add mislav ...
> git remote add xoebus ...
> git fetch --multiple mislav xoebus

git cherry-pick

$ git cherry-pick http://github.com/mislav/REPO/commit/SHA
> git remote add -f mislav git://github.com/mislav/REPO.git
> git cherry-pick SHA

$ git cherry-pick mislav@SHA
> git remote add -f mislav git://github.com/mislav/CURRENT_REPO.git
> git cherry-pick SHA

$ git cherry-pick mislav@SHA
> git fetch mislav
> git cherry-pick SHA

git am

$ git am https://github.com/defunkt/hub/pull/55
> curl https://github.com/defunkt/hub/pull/55.patch -o /tmp/55.patch
> git am /tmp/55.patch

$ git am --ignore-whitespace https://github.com/davidbalbert/hub/commit/fdb9921
> curl https://github.com/davidbalbert/hub/commit/fdb9921.patch -o /tmp/fdb9921.patch
> git am --ignore-whitespace /tmp/fdb9921.patch

git fork

$ git fork
... hardcore forking action ...
> git remote add YOUR_USER [email protected]:YOUR_USER/CURRENT_REPO.git

git init

$ git init -g
> git init
> git remote add origin [email protected]:YOUR_USER/REPO.git

git create

$ git create
... hardcore creating action ...
> git remote add origin [email protected]:YOUR_USER/CURRENT_REPO.git

git push

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

git browse

$ git browse
> open https://github.com/CURRENT_REPO

$ git browse -- issues
> open https://github.com/CURRENT_REPO/issues

$ git browse schacon/ticgit
> open https://github.com/schacon/ticgit

$ git browse resque
> open https://github.com/YOUR_USER/resque

$ git browse resque network
> open https://github.com/YOUR_USER/resque/network

git compare

$ git compare refactor
> open https://github.com/CURRENT_REPO/compare/refactor

$ git compare 1.0...1.1
> open https://github.com/CURRENT_REPO/compare/1.0...1.1

$ git compare -u fix
> (https://github.com/CURRENT_REPO/compare/fix)

$ git compare other-user patch
> open https://github.com/other-user/REPO/compare/patch

git help

$ git help
> (improved git help)
$ git help hub
> (hub man page)

BUGS

http://github.com/defunkt/hub/issues

AUTHORS

https://github.com/defunkt/hub/contributors

SEE ALSO

git(1), git-clone(1), git-remote(1), git-init(1), http://github.com, http://github.com/defunkt/hub

  1. DEFUNKT
  2. December 2010
  3. hub(1)