Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

306 lines (240 sloc) 12.015 kb
<!DOCTYPE html>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.5'>
<title>hub(1) -- git + hub = github</title>
<style type='text/css'>
body {margin:0}
#man, #man code, #man pre, #man tt, #man kbd, #man samp {
background:#fff; }
#man { max-width:89ex; text-align:justify; margin:0 25px 25px 25px }
#man h1, #man h2, #man h3 { color:#232221;clear:left }
#man h1 { font-size:28px; margin:15px 0 30px 0; text-align:center }
#man h2 { font-size:18px; margin-bottom:0; margin-top:10px; line-height:1.3; }
#man h3 { font-size:16px; margin:0 0 0 4ex; }
#man p, #man ul, #man ol, #man dl, #man pre { margin:0 0 18px 0; }
#man pre {
padding:5px 7px;
margin:0px 0 20px 0;
border-left:2ex solid #ddd}
#man pre + h2, #man pre + h3 {
#man h2 + pre, #man h3 + pre {
#man > p, #man > ul, #man > ol, #man > dl, #man > pre { margin-left:8ex; }
#man dt { margin:0; clear:left }
#man dt.flush { float:left; width:8ex }
#man dd { margin:0 0 0 9ex }
#man code, #man strong, #man b { font-weight:bold; color:#131211; }
#man pre code { font-weight:normal; color:#232221; background:inherit }
#man em, var, u {
font-style:normal; color:#333231; border-bottom:1px solid #999; }
#man { display:none; }
#man, #man li { margin:2px 0 10px 0; padding:0;
float:left; width:33%; list-style-type:none;
text-transform:uppercase; font-size:18px; color:#999;
#man { width:100%; }
#man { text-align:left }
#man { text-align:center;letter-spacing:4px }
#man { text-align:right }
#man a { color:#999 }
#man a:hover { color:#333231 }
<div id='man'>
<h1 class='man-title'>hub(1)</h1>
<ol class='head man'>
<li class='tl'>hub(1)</li>
<li class='tc'>Git Manual</li>
<li class='tr'>hub(1)</li>
<h2 id='NAME'>NAME</h2>
<p><code>hub</code> -- git + hub = github</p>
<p><code>hub</code> <var>COMMAND</var> <var>OPTIONS</var><br />
<code>hub alias</code> [<code>-s</code>] <var>SHELL</var></p>
<p><code>git init -g</code> <var>OPTIONS</var><br />
<code>git clone</code> [<code>-p</code>] <var>OPTIONS</var> [<var>USER</var>/]<var>REPOSITORY</var> <var>DIRECTORY</var><br />
<code>git remote add</code> [<code>-p</code>] <var>OPTIONS</var> <var>USER</var>[/<var>REPOSITORY</var>]<br />
<code>git fetch</code> <var>USER-1</var>,[<var>USER-2</var>,...]<br />
<code>git cherry-pick</code> <var>GITHUB-REF</var><br />
<code>git push</code> <var>REMOTE-1</var>,<var>REMOTE-2</var>,...,<var>REMOTE-N</var> <var>REF</var><br />
<code>git browse</code> [<code>-p</code>] [<code>-u</code>] [[<var>USER</var><code>/</code>]<var>REPOSITORY</var>] [SUBPAGE]<br />
<code>git compare</code> [<code>-p</code>] [<code>-u</code>] [<var>USER</var>] [<var>START</var>...]<var>END</var><br />
<code>git submodule add</code> [<code>-p</code>] <var>OPTIONS</var> [<var>USER</var>/]<var>REPOSITORY</var> <var>DIRECTORY</var><br />
<code>git fork</code> [<code>--no-remote</code>]</p>
<p><code>hub</code> enhances various <code>git</code> commands with GitHub remote expansion. The
alias command displays information on configuring your environment:</p>
<dt><code>hub alias</code> [<code>-s</code>] <var>SHELL</var></dt><dd><p>Writes shell aliasing code for <var>SHELL</var> (<code>bash</code>, <code>sh</code>, <code>zsh</code>,
<code>csh</code>) to standard output. With the <code>-s</code> option, the output of
this command can be evaluated directly within the shell:<br />
<code>eval $(hub alias -s bash)</code></p></dd>
<dt><code>git init</code> <code>-g</code> <var>OPTIONS</var></dt><dd><p>Create a git repository as with git-init(1) and add remote <code>origin</code> at
"<var>USER</var>/<var>REPOSITORY</var>.git"; <var>USER</var> is your GitHub username and
<var>REPOSITORY</var> is the current working directory's basename.</p></dd>
<dt><code>git clone</code> [<code>-p</code>] <var>OPTIONS</var> [<var>USER</var><code>/</code>]<var>REPOSITORY</var> <var>DIRECTORY</var></dt><dd><p>Clone repository "git://<var>USER</var>/<var>REPOSITORY</var>.git" into
<var>DIRECTORY</var> as with git-clone(1). When <var>USER</var>/ is omitted, assumes
your GitHub login. With <code>-p</code>, use private remote
<dt><code>git remote add</code> [<code>-p</code>] <var>OPTIONS</var> <var>USER</var>[<code>/</code><var>REPOSITORY</var>]</dt><dd><p>Add remote "git://<var>USER</var>/<var>REPOSITORY</var>.git" as with
git-remote(1). When /<var>REPOSITORY</var> is omitted, the basename of the
current working directory is used. With <code>-p</code>, use private remote
"<var>USER</var>/<var>REPOSITORY</var>.git". If <var>USER</var> is "origin"
then uses your GitHub login.</p></dd>
<dt><code>git fetch</code> <var>USER-1</var>,[<var>USER-2</var>,...]</dt><dd><p>Adds missing remote(s) with <code>git remote add</code> prior to fetching. New
remotes are only added if they correspond to valid forks on GitHub.</p></dd>
<dt><code>git cherry-pick</code> <var>GITHUB-REF</var></dt><dd><p>Cherry-pick a commit from a fork using either full URL to the commit
or GitHub-flavored Markdown notation, which is <code>user@sha</code>. If the remote
doesn't yet exist, it will be added. A <code>git fetch &lt;user></code> is issued
prior to the cherry-pick attempt.</p></dd>
<dt><code>git push</code> <var>REMOTE-1</var>,<var>REMOTE-2</var>,...,<var>REMOTE-N</var> <var>REF</var></dt><dd><p>Push <var>REF</var> to each of <var>REMOTE-1</var> through <var>REMOTE-N</var> by executing
multiple <code>git push</code> commands.</p></dd>
<dt><code>git browse</code> [<code>-p</code>] [<code>-u</code>] [[<var>USER</var><code>/</code>]<var>REPOSITORY</var>] [SUBPAGE]</dt><dd><p>Open repository's GitHub page in the system's default web browser
using <code>open(1)</code> or the <code>BROWSER</code> env variable. Use <code>-p</code> to open a
page with https. If the repository isn't specified, <code>browse</code> 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").</p></dd>
<dt><code>git compare</code> [<code>-p</code>] [<code>-u</code>] [<var>USER</var>] [<var>START</var>...]<var>END</var></dt><dd><p>Open a GitHub compare view page in the system's default web browser.
<var>START</var> to <var>END</var> are branch names, tag names, or commit SHA1s specifying
the range of history to compare. If <var>START</var> is omitted, GitHub will
compare against the base branch (the default is "master").</p></dd>
<dt><code>git submodule add</code> [<code>-p</code>] <var>OPTIONS</var> [<var>USER</var>/]<var>REPOSITORY</var> <var>DIRECTORY</var></dt><dd><p>Submodule repository "git://<var>USER</var>/<var>REPOSITORY</var>.git" into
<var>DIRECTORY</var> as with git-submodule(1). When <var>USER</var>/ is omitted, assumes
your GitHub login. With <code>-p</code>, use private remote
<dt><code>git fork</code> [<code>--no-remote</code>]</dt><dd><p>Forks the original project (referenced by "origin" remote) on GitHub and
adds a new remote for it under your username. Requires <code>github.token</code> to
be set (see CONFIGURATION).</p></dd>
<dt><code>git help</code></dt><dd><p>Display enhanced git-help(1).</p></dd>
<p>Use git-config(1) to display the currently configured GitHub username:</p>
<pre><code>$ git config --global github.user
<p>Or, set the GitHub username and token with:</p>
<pre><code>$ git config --global github.user &lt;username>
$ git config --global github.token &lt;token>
<p>See <a href=""></a> for more
<p>You can also tell <code>hub</code> to use <code>http://</code> rather than <code>git://</code> when
<pre><code>$ git config --global --bool hub.http-clone true
<h3>git clone</h3>
<pre><code>$ git clone schacon/ticgit
&gt; git clone git://
$ git clone -p schacon/ticgit
&gt; git clone
$ git clone resque
&gt; git clone git://
$ git clone -p resque
&gt; git clone
<h3>git remote add</h3>
<pre><code>$ git remote add rtomayko
&gt; git remote add rtomayko git://
$ git remote add -p rtomayko
&gt; git remote add rtomayko
$ git remote add origin
&gt; git remote add origin git://
<h3>git fetch</h3>
<pre><code>$ git fetch mislav
&gt; git remote add mislav git://
&gt; git fetch mislav
$ git fetch mislav,xoebus
&gt; git remote add mislav ...
&gt; git remote add xoebus ...
&gt; git fetch --multiple mislav xoebus
<h3>git cherry-pick</h3>
<pre><code>$ git cherry-pick
&gt; git remote add -f mislav git://
&gt; git cherry-pick SHA
$ git cherry-pick mislav@SHA
&gt; git remote add -f mislav git://
&gt; git cherry-pick SHA
$ git cherry-pick mislav@SHA
&gt; git fetch mislav
&gt; git cherry-pick SHA
<h3>git fork</h3>
<pre><code>$ git fork
... hardcore forking action ...
&gt; git remote add YOUR_USER
<h3>git init</h3>
<pre><code>$ git init -g
&gt; git init
&gt; git remote add origin
<h3>git push</h3>
<pre><code>$ git push origin,staging,qa bert_timeout
&gt; git push origin bert_timeout
&gt; git push staging bert_timeout
&gt; git push qa bert_timeout
<h3>git browse</h3>
<pre><code>$ git browse
&gt; open
$ git browse -- issues
&gt; open
$ git browse schacon/ticgit
&gt; open
$ git browse -p schacon/ticgit
&gt; open
$ git browse resque
&gt; open
$ git browse resque network
&gt; open
$ git browse -p resque
&gt; open
<h3>git compare</h3>
<pre><code>$ git compare refactor
&gt; open
$ git compare 1.0...1.1
&gt; open
$ git compare -u fix
&gt; (
$ git compare other-user patch
&gt; open
<h3>git help</h3>
<pre><code>$ git help
&gt; (improved git help)
$ git help hub
&gt; (hub man page)
<p><a href=""></a></p>
<p>Chris Wanstrath :: :: @defunkt</p>
<h2>SEE ALSO</h2>
<p>git(1), git-clone(1), git-remote(1), git-init(1),
<a href=""></a>,
<a href=""></a></p>
<ol class='foot man'>
<li class='tl'>DEFUNKT</li>
<li class='tc'>April 2010</li>
<li class='tr'>hub(1)</li>
Jump to Line
Something went wrong with that request. Please try again.