." generated with Ronn/v0.7.3 ." github.com/rtomayko/ronn/tree/0.7.3 . .TH “HUB” “1” “February 2014” “GITHUB” “Hub Manual” . .SH “NAME” fBhubfR - git + hub = github . .SH “SYNOPSIS” fBhubfR [fB--noopfR] fICOMMANDfR fIOPTIONSfR . .br fBhub aliasfR [fB-sfR] [fISHELLfR] . .SS “Expanded git commands:” fBgit init -gfR fIOPTIONSfR . .br fBgit clonefR [fB-pfR] fIOPTIONSfR [fIUSERfR/]fIREPOSITORYfR fIDIRECTORYfR . .br fBgit remote addfR [fB-pfR] fIOPTIONSfR fIUSERfR[/fIREPOSITORYfR] . .br fBgit remote set-urlfR [fB-pfR] fIOPTIONSfR fIREMOTE-NAMEfR fIUSERfR[/fIREPOSITORYfR] . .br fBgit fetchfR fIUSER-1fR,[fIUSER-2fR,...] . .br fBgit checkoutfR fIPULLREQ-URLfR [fIBRANCHfR] . .br fBgit mergefR fIPULLREQ-URLfR . .br fBgit cherry-pickfR fIGITHUB-REFfR . .br fBgit amfR fIGITHUB-URLfR . .br fBgit applyfR fIGITHUB-URLfR . .br fBgit pushfR fIREMOTE-1fR,fIREMOTE-2fR,...,fIREMOTE-NfR [fIREFfR] . .br fBgit submodule addfR [fB-pfR] fIOPTIONSfR [fIUSERfR/]fIREPOSITORYfR fIDIRECTORYfR . .SS “Custom git commands:” fBgit createfR [fINAMEfR] [fB-pfR] [fB-dfR fIDESCRIPTIONfR] [fB-hfR fIHOMEPAGEfR] . .br fBgit browsefR [fB-ufR] [[fIUSERfRfB/fR]fIREPOSITORYfR] [SUBPAGE] . .br fBgit comparefR [fB-ufR] [fIUSERfR] [[fISTARTfR...]fIENDfR] . .br fBgit forkfR [fB--no-remotefR] . .br fBgit pull-requestfR [fB-ofR|fB--browsefR] [fB-ffR] [fB-mfR fIMESSAGEfR|fB-FfR fIFILEfR|fB-ifR fIISSUEfR|fIISSUE-URLfR] [fB-bfR fIBASEfR] [fB-hfR fIHEADfR] . .br fBgit ci-statusfR [fB-vfR] [fICOMMITfR] . .SH “DESCRIPTION” hub enhances various git commands to ease most common workflows with GitHub. . .TP fBhub --noopfR fICOMMANDfR Shows which command(s) would be run as a result of the current command. Doesn't perform anything. . .TP fBhub aliasfR [fB-sfR] [fISHELLfR] Shows shell instructions for wrapping git. If given, fISHELLfR specifies the type of shell; otherwise defaults to the value of SHELL environment variable. With fB-sfR, outputs shell script suitable for fBevalfR. . .TP fBgit initfR fB-gfR fIOPTIONSfR Create a git repository as with git-init(1) and add remote fBoriginfR at “git@github.com:fIUSERfR/fIREPOSITORYfR.git”; fIUSERfR is your GitHub username and fIREPOSITORYfR is the current working directory's basename. . .TP fBgit clonefR [fB-pfR] fIOPTIONSfR [fIUSERfRfB/fR]fIREPOSITORYfR fIDIRECTORYfR Clone repository “git://github.com/fIUSERfR/fIREPOSITORYfR.git” into fIDIRECTORYfR as with git-clone(1). When fIUSERfR/ is omitted, assumes your GitHub login. . .IP If the repository is private or the current user has push access to the repository, hub will use the ssh protocol for cloning. Use fB-pfR to select the ssh protocol unconditionally. HTTPS protocol can be used instead by setting “hub.protocol” (see fICONFIGURATIONfR). . .TP fBgit remote addfR [fB-pfR] fIOPTIONSfR fIUSERfR[fB/fRfIREPOSITORYfR] Add remote “git://github.com/fIUSERfR/fIREPOSITORYfR.git” as with git-remote(1). When /fIREPOSITORYfR is omitted, the basename of the current working directory is used. With fB-pfR, use private remote “git@github.com:fIUSERfR/fIREPOSITORYfR.git”. If fIUSERfR is “origin” then uses your GitHub login. . .TP fBgit remote set-urlfR [fB-pfR] fIOPTIONSfR fIREMOTE-NAMEfR fIUSERfR[/fIREPOSITORYfR] Sets the url of remote fIREMOTE-NAMEfR using the same rules as fBgit remote addfR. . .TP fBgit fetchfR fIUSER-1fR,[fIUSER-2fR,...] Adds missing remote(s) with fBgit remote addfR prior to fetching. New remotes are only added if they correspond to valid forks on GitHub. . .TP fBgit checkoutfR fIPULLREQ-URLfR [fIBRANCHfR] Checks out the head of the pull request as a local branch, to allow for reviewing, rebasing and otherwise cleaning up the commits in the pull request before merging. The name of the local branch can explicitly be set with fIBRANCHfR. . .TP fBgit mergefR fIPULLREQ-URLfR Merge the pull request with a commit message that includes the pull request ID and title, similar to the GitHub Merge Button. . .TP fBgit cherry-pickfR fIGITHUB-REFfR Cherry-pick a commit from a fork using either full URL to the commit or GitHub-flavored Markdown notation, which is fBuser@shafR. If the remote doesn't yet exist, it will be added. A fBgit fetch <user>fR is issued prior to the cherry-pick attempt. . .TP fBgit [am|apply]fR fIGITHUB-URLfR Downloads the patch file for the pull request or commit at the URL and applies that patch from disk with fBgit amfR or fBgit applyfR. Similar to fBcherry-pickfR, but doesn't add new remotes. fBgit amfR creates commits while preserving authorship info while fBapplyfR only applies the patch to the working copy. . .TP fBgit pushfR fIREMOTE-1fR,fIREMOTE-2fR,...,fIREMOTE-NfR [fIREFfR] Push fIREFfR to each of fIREMOTE-1fR through fIREMOTE-NfR by executing multiple fBgit pushfR commands. . .TP fBgit submodule addfR [fB-pfR] fIOPTIONSfR [fIUSERfR/]fIREPOSITORYfR fIDIRECTORYfR Submodule repository “git://github.com/fIUSERfR/fIREPOSITORYfR.git” into fIDIRECTORYfR as with git-submodule(1). When fIUSERfR/ is omitted, assumes your GitHub login. With fB-pfR, use private remote “git@github.com:fIUSERfR/fIREPOSITORYfR.git”. . .TP fBgit helpfR Display enhanced git-help(1). . .P hub also adds some custom commands that are otherwise not present in git: . .TP fBgit createfR [fINAMEfR] [fB-pfR] [fB-dfR fIDESCRIPTIONfR] [fB-hfR fIHOMEPAGEfR] Create a new public GitHub repository from the current git repository and add remote fBoriginfR at “git@github.com:fIUSERfR/fIREPOSITORYfR.git”; fIUSERfR is your GitHub username and fIREPOSITORYfR is the current working directory name. To explicitly name the new repository, pass in fINAMEfR, optionally in fIORGANIZATIONfR/fINAMEfR form to create under an organization you're a member of. With fB-pfR, create a private repository, and with fB-dfR and fB-hfR set the repository's description and homepage URL, respectively. . .TP fBgit browsefR [fB-ufR] [[fIUSERfRfB/fR]fIREPOSITORYfR] [SUBPAGE] Open repository's GitHub page in the system's default web browser using fBopen(1)fR or the fBBROWSERfR env variable. If the repository isn't specified, fBbrowsefR opens the page of the repository found in the current directory. If SUBPAGE is specified, the browser will open on the specified subpage: one of “wiki”, “commits”, “issues” or other (the default is “tree”). With fB-ufR, outputs the URL rather than opening the browser. . .TP fBgit comparefR [fB-ufR] [fIUSERfR] [[fISTARTfR...]fIENDfR] Open a GitHub compare view page in the system's default web browser. fISTARTfR to fIENDfR are branch names, tag names, or commit SHA1s specifying the range of history to compare. If a range with two dots (fBa..bfR) is given, it will be transformed into one with three dots. If fISTARTfR is omitted, GitHub will compare against the base branch (the default is “master”). If fIENDfR is omitted, GitHub compare view is opened for the current branch. With fB-ufR, outputs the URL rather than opening the browser. . .TP fBgit forkfR [fB--no-remotefR] Forks the original project (referenced by “origin” remote) on GitHub and adds a new remote for it under your username. . .TP fBgit pull-requestfR [fB-ofR|fB--browsefR] [fB-ffR] [fB-mfR fIMESSAGEfR|fB-FfR fIFILEfR|fB-ifR fIISSUEfR|fIISSUE-URLfR] [fB-bfR fIBASEfR] [fB-hfR fIHEADfR] Opens a pull request on GitHub for the project that the “origin” remote points to. The default head of the pull request is the current branch. Both base and head of the pull request can be explicitly given in one of the following formats: “branch”, “owner:branch”, “owner/repo:branch”. This command will abort operation if it detects that the current topic branch has local commits that are not yet pushed to its upstream branch on the remote. To skip this check, use fB-ffR. . .IP Without fIMESSAGEfR or fIFILEfR, a text editor will open in which title and body of the pull request can be entered in the same manner as git commit message. Pull request message can also be passed via stdin with fB-F -fR. . .IP With fB-ofR or fB--browsefR, the new pull request will open in the web browser. . .IP Issue to pull request conversion via fB-i <ISSUE>fR or fIISSUE-URLfR arguments is deprecated and will likely be removed from the future versions of both hub and GitHub API. . .TP fBgit ci-statusfR [fB-vfR] [fICOMMITfR] Looks up the SHA for fICOMMITfR in GitHub Status API and displays the latest status. Exits with one of: . .br success (0), error (1), failure (1), pending (2), no status (3) . .IP If fB-vfR is given, additionally print the URL to CI build results. . .SH “CONFIGURATION” Hub will prompt for GitHub username & password the first time it needs to access the API and exchange it for an OAuth token, which it saves in “~/.config/hub”. . .P To avoid being prompted, use fIGITHUB_USERfR and fIGITHUB_PASSWORDfR environment variables. . .P If you prefer the HTTPS protocol for GitHub repositories, you can set “hub.protocol” to “https”. This will affect fBclonefR, fBforkfR, fBremote addfR and other operations that expand references to GitHub repositories as full URLs that otherwise use git and ssh protocols. . .IP “” 4 . .nf
$ git config --global hub.protocol https . .fi . .IP “” 0 . .SS “GitHub Enterprise” By default, hub will only work with repositories that have remotes which point to github.com. GitHub Enterprise hosts need to be whitelisted to configure hub to treat such remotes same as github.com: . .IP “” 4 . .nf
$ git config --global --add hub.host my.git.org . .fi . .IP “” 0 . .P The default host for commands like fBinitfR and fBclonefR is still github.com, but this can be affected with the fIGITHUB_HOSTfR environment variable: . .IP “” 4 . .nf
$ GITHUB_HOST=my.git.org git clone myproject . .fi . .IP “” 0 . .SH “EXAMPLES” . .SS “git clone” . .nf
$ 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 . .fi . .SS “git remote add” . .nf
$ 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 . .fi . .SS “git fetch” . .nf
$ 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 . .fi . .SS “git cherry-pick” . .nf
$ git cherry-pick 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 . .fi . .SS “git am, git apply” . .nf
$ git am github.com/defunkt/hub/pull/55
> git am /tmp/55.patch
$ git am --ignore-whitespace github.com/davidbalbert/hub/commit/fdb9921
> git am --ignore-whitespace /tmp/fdb9921.patch
$ git apply gist.github.com/8da7fb575debd88c54cf
> git apply /tmp/gist-8da7fb575debd88c54cf.txt . .fi . .SS “git fork” . .nf
$ git fork
> git remote add -f YOUR_USER git@github.com:YOUR_USER/CURRENT_REPO.git . .fi . .SS “git pull-request” . .nf
# while on a topic branch called “feature”: $ git pull-request
# explicit title, pull base & head: $ git pull-request -m “Implemented feature X” -b defunkt:master -h mislav:feature . .fi . .SS “git checkout” . .nf
$ git checkout github.com/defunkt/hub/pull/73 > git remote add -f -t feature git://github:com/mislav/hub.git > git checkout --track -B mislav-feature mislav/feature
$ git checkout github.com/defunkt/hub/pull/73 custom-branch-name . .fi . .SS “git merge” . .nf
$ git merge github.com/defunkt/hub/pull/73 > git fetch git://github.com/mislav/hub.git +refs/heads/feature:refs/remotes/mislav/feature > git merge mislav/feature --no-ff -m 'Merge pull request #73 from mislav/feature...' . .fi . .SS “git create” . .nf
$ git create
> git remote add origin git@github.com:YOUR_USER/CURRENT_REPO.git
# with description: $ git create -d 'It shall be mine, all mine!'
$ git create recipes
> git remote add origin git@github.com:YOUR_USER/recipes.git
$ git create sinatra/recipes
> git remote add origin git@github.com:sinatra/recipes.git . .fi . .SS “git init” . .nf
$ git init -g > git init > git remote add origin git@github.com:YOUR_USER/REPO.git . .fi . .SS “git push” . .nf
$ git push origin,staging,qa bert_timeout > git push origin bert_timeout > git push staging bert_timeout > git push qa bert_timeout . .fi . .SS “git browse” . .nf
$ git browse > open github.com/YOUR_USER/CURRENT_REPO
$ git browse -- commit/SHA > open github.com/YOUR_USER/CURRENT_REPO/commit/SHA
$ git browse -- issues > open github.com/YOUR_USER/CURRENT_REPO/issues
$ git browse schacon/ticgit > open github.com/schacon/ticgit
$ git browse schacon/ticgit commit/SHA > open github.com/schacon/ticgit/commit/SHA
$ git browse resque > open github.com/YOUR_USER/resque
$ git browse resque network > open github.com/YOUR_USER/resque/network . .fi . .SS “git compare” . .nf
$ git compare refactor > open github.com/CURRENT_REPO/compare/refactor
$ git compare 1.0..1.1 > open github.com/CURRENT_REPO/compare/1.0...1.1
$ git compare -u fix > (github.com/CURRENT_REPO/compare/fix)
$ git compare other-user patch > open github.com/other-user/REPO/compare/patch . .fi . .SS “git submodule” . .nf
$ git submodule add wycats/bundler vendor/bundler > git submodule add git://github.com/wycats/bundler.git vendor/bundler
$ git submodule add -p wycats/bundler vendor/bundler > git submodule add git@github.com:wycats/bundler.git vendor/bundler
$ git submodule add -b ryppl --name pip ryppl/pip vendor/pip > git submodule add -b ryppl --name pip git://github.com/ryppl/pip.git vendor/pip . .fi . .SS “git ci-status” . .nf
$ git ci-status [commit] > (prints CI state of commit and exits with appropriate code) > One of: success (0), error (1), failure (1), pending (2), no status (3) . .fi . .SS “git help” . .nf
$ git help > (improved git help) $ git help hub > (hub man page) . .fi . .SH “BUGS” fIgithub.com/github/hub/issuesfR . .SH “AUTHORS” fIgithub.com/github/hub/contributorsfR . .SH “SEE ALSO” git(1), git-clone(1), git-remote(1), git-init(1), fIgithub.comfR, fIgithub.com/github/hubfR