| CARVIEW |
hub(1)
- hub(1)
- Git Manual
- hub(1)
NAME
hub -- git + hub = github
SYNOPSIS
hub COMMAND OPTIONS
hub alias [-s] SHELL
git init -g OPTIONS
git clone [-p] OPTIONS [USER/]REPOSITORY DIRECTORY
git remote add [-p] OPTIONS USER[/REPOSITORY]
git push REMOTE-1,REMOTE-2,...,REMOTE-N REF
git fork
git browse [-p] [USER/]REPOSITORY
git submodule add [-p] OPTIONS [USER/]REPOSITORY DIRECTORY
DESCRIPTION
hub enhances various git commands with GitHub remote expansion. The
alias command displays information on configuring your environment:
-
hub alias[-s] SHELL:
Writes shell aliasing code for SHELL (bash,sh,zsh,csh) to standard output. With the-soption, the output of this command can be evaluated directly within the shell eval $(hub alias -s bash)-
git init-gOPTIONS:
Create a git repository as with git-init(1) and add remoteoriginat "git@github.com:USER/REPOSITORY.git"; USER is your GitHub username and REPOSITORY is the current working directory's basename. -
git clone[-p] OPTIONS [USER/]REPOSITORY DIRECTORY:
Clone repository "git://github.com/USER/REPOSITORY.git" into DIRECTORY as with git-clone(1). When USER/ is omitted, assumes your GitHub login. With-p, use private remote "git@github.com:USER/REPOSITORY.git". -
git remote add[-p] OPTIONS USER[/REPOSITORY]:
Add remote "git://github.com/USER/REPOSITORY.git" as with git-remote(1). When /REPOSITORY is omitted, the basename of the current working directory is used. With-p, use private remote "git@github.com:USER/REPOSITORY.git". If USER is "origin" then uses your GitHub login. -
git pushREMOTE-1,REMOTE-2,...,REMOTE-N REF:
Push REF to each of REMOTE-1 through REMOTE-N by executing multiplegit pushcommands. -
git fork:
Forks the original repo on GitHub and adds the new remote under your username. It requires your GitHub login and token to be present. See CONFIGURATION below. -
git browse[-p] [[USER/]REPOSITORY]:
Open repository's GitHub page in the system's default web browser usingopen(1)or theBROWSERenv variable. Use-pto open a page with https. If the repository isn't specified,browseopens the page of the repository found in the current directory. -
git submodule add[-p] OPTIONS [USER/]REPOSITORY DIRECTORY:
Submodule repository "git://github.com/USER/REPOSITORY.git" into DIRECTORY as with git-submodule(1). When USER/ is omitted, assumes your GitHub login. With-p, use private remote "git@github.com:USER/REPOSITORY.git". -
git fork[--no-remote]:
Forks the original project (as specified in "origin" remote) on GitHub and adds a new remote named USER referencing the newly created repo. Requiresgithub.tokento be set (see CONFIGURATION). -
git help:
Display enhanced git-help(1).
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 https://github.com/guides/local-github-config for more information.
You can also tell hub to use https:// rather than git:// when
cloning:
$ git config --global --add hub.http-clone yes
EXAMPLES
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 clone resque
> git clone git://github.com/YOUR_USER/resque.git
$ git clone -p resque
> git clone git@github.com: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 git@github.com:rtomayko/CURRENT_REPO.git
$ git remote add origin
> git remote add origin git://github.com/YOUR_USER/CURRENT_REPO.git
git fork
$ git fork
... hardcore forking action ...
> git remote add YOUR_USER git@github.com:YOUR_USER/CURRENT_REPO.git
git init
$ git init -g
> git init
> git remote add origin git@github.com:YOUR_USER/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 schacon/ticgit
> open https://github.com/schacon/ticgit
$ git browse -p schacon/ticgit
> open https://github.com/schacon/ticgit
$ git browse resque
> open https://github.com/YOUR_USER/resque
$ git browse -p resque
> open https://github.com:YOUR_USER/resque
git help
$ git help
> (improved git help)
$ git help hub
> (hub man page)
BUGS
https://github.com/defunkt/hub/issues
AUTHOR
Chris Wanstrath :: chris@ozmm.org :: @defunkt
SEE ALSO
git(1), git-clone(1), git-remote(1), git-init(1), https://github.com, https://github.com/defunkt/hub
- DEFUNKT
- April 2010
- hub(1)