hub.1.html 10.0 KB
Newer Older
C
Chris Wanstrath 已提交
1 2 3 4
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
  <meta name='generator' value='Ronn/v0.5'>
C
Chris Wanstrath 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
  <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 {
      font-family:consolas,monospace;
      font-size:16px;
      line-height:1.3;
      color:#343331;
      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 {
      color:#333231;
      background:#edeceb;
      padding:5px 7px;
      margin:0px 0 20px 0;
      border-left:2ex solid #ddd}
    #man pre + h2, #man pre + h3 {
      margin-top:22px;
    }
    #man h2 + pre, #man h3 + pre {
      margin-top:5px;
    }
    #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 h1.man-title { display:none; }
    #man ol.man, #man ol.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;
      letter-spacing:1px;}
    #man ol.man { width:100%; }
    #man ol.man li.tl { text-align:left }
    #man ol.man li.tc { text-align:center;letter-spacing:4px }
    #man ol.man li.tr { text-align:right }
    #man ol.man a { color:#999 }
    #man ol.man a:hover { color:#333231 }
  </style>
</head>
<body>
<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>
</ol>

<h2 id='NAME'>NAME</h2>
<p><code>hub</code> -- git + hub = github</p>
67

C
Chris Wanstrath 已提交
68 69
<h2>SYNOPSIS</h2>

C
Chris Wanstrath 已提交
70 71
<p><code>hub</code> <var>COMMAND</var> <var>OPTIONS</var>
<code>hub alias</code> [<code>-s</code>] <var>SHELL</var></p>
C
Chris Wanstrath 已提交
72

73 74 75 76 77 78
<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 push</code> <var>REMOTE-1</var>,<var>REMOTE-2</var>,...,<var>REMOTE-N</var> <var>REF</var><br />
<code>git fork</code><br />
<code>git browse</code> [<code>-p</code>] [<var>USER</var>/]<var>REPOSITORY</var><br />
S
Stephen Celis 已提交
79
<code>git submodule add</code> [<code>-p</code>] <var>OPTIONS</var> [<var>USER</var>/]<var>REPOSITORY</var> <var>DIRECTORY</var></p>
C
Chris Wanstrath 已提交
80 81 82 83 84 85 86

<h2>DESCRIPTION</h2>

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

<dl>
87
<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>,
C
Chris Wanstrath 已提交
88
<code>csh</code>) to standard output. With the <code>-s</code> option, the output of
89 90 91 92 93 94
this command can be evaluated directly within the shell:
<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
"git@github.com:<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://github.com/<var>USER</var>/<var>REPOSITORY</var>.git" into
C
Chris Wanstrath 已提交
95 96
<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
97 98
"git@github.com:<var>USER</var>/<var>REPOSITORY</var>.git".</p></dd>
<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://github.com/<var>USER</var>/<var>REPOSITORY</var>.git" as with
C
Chris Wanstrath 已提交
99 100
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
C
Chris Wanstrath 已提交
101
"git@github.com:<var>USER</var>/<var>REPOSITORY</var>.git". If <var>USER</var> is "origin"
102 103 104 105
then uses your GitHub login.</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 fork</code></dt><dd><p>Forks the original repo on GitHub and adds the new remote under your
C
Chris Wanstrath 已提交
106
username. It requires your GitHub login and token to be present. See
107 108
CONFIGURATION below.</p></dd>
<dt><code>git browse</code> [<code>-p</code>] [[<var>USER</var><code>/</code>]<var>REPOSITORY</var>]</dt><dd><p>Open repository's GitHub page in the system's default web browser
C
Chris Wanstrath 已提交
109
using <code>open(1)</code> or the <code>BROWSER</code> env variable. Use <code>-p</code> to open a
110
page with https. If the repository isn't specified, <code>browse</code> opens
111 112 113 114 115 116
the page of the repository found in the current directory.</p></dd>
<dt><code>git compare</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,
the repository's default branch is assumed.</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://github.com/<var>USER</var>/<var>REPOSITORY</var>.git" into
S
Stephen Celis 已提交
117 118
<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
119 120
"git@github.com:<var>USER</var>/<var>REPOSITORY</var>.git".</p></dd>
<dt><code>git fork</code> [<code>--no-remote</code>]</dt><dd><p>Forks the original project (as specified in "origin" remote) on GitHub
121
and adds a new remote named <var>USER</var> referencing the newly created repo.
122 123
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>
C
Chris Wanstrath 已提交
124 125 126 127 128 129 130 131 132 133
</dl>


<h2>CONFIGURATION</h2>

<p>Use git-config(1) to display the currently configured GitHub username:</p>

<pre><code>$ git config --global github.user
</code></pre>

134
<p>Or, set the GitHub username and token with:</p>
C
Chris Wanstrath 已提交
135

136 137
<pre><code>$ git config --global github.user &lt;username>
$ git config --global github.token &lt;token>
C
Chris Wanstrath 已提交
138 139
</code></pre>

C
Chris Wanstrath 已提交
140 141 142 143 144 145 146 147
<p>See <a href="http://github.com/guides/local-github-config">http://github.com/guides/local-github-config</a> for more
information.</p>

<p>You can also tell <code>hub</code> to use <code>http://</code> rather than <code>git://</code> when
cloning:</p>

<pre><code>$ git config --global --add hub.http-clone yes
</code></pre>
C
Chris Wanstrath 已提交
148

C
Chris Wanstrath 已提交
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
<h2>EXAMPLES</h2>

<h3>git clone</h3>

<pre><code>$ git clone schacon/ticgit
&gt; git clone git://github.com/schacon/ticgit.git

$ git clone -p schacon/ticgit
&gt; git clone git@github.com:schacon/ticgit.git

$ git clone resque
&gt; git clone git://github.com/YOUR_USER/resque.git

$ git clone -p resque
&gt; git clone git@github.com:YOUR_USER/resque.git
</code></pre>

<h3>git remote add</h3>

<pre><code>$ git remote add rtomayko
&gt; git remote add rtomayko git://github.com/rtomayko/CURRENT_REPO.git

$ git remote add -p rtomayko
&gt; git remote add rtomayko git@github.com:rtomayko/CURRENT_REPO.git
C
Chris Wanstrath 已提交
173 174

$ git remote add origin
C
Chris Wanstrath 已提交
175
&gt; git remote add origin git://github.com/YOUR_USER/CURRENT_REPO.git
C
Chris Wanstrath 已提交
176 177
</code></pre>

178 179 180 181 182 183 184
<h3>git fork</h3>

<pre><code>$ git fork
... hardcore forking action ...
&gt; git remote add YOUR_USER git@github.com:YOUR_USER/CURRENT_REPO.git
</code></pre>

C
Chris Wanstrath 已提交
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
<h3>git init</h3>

<pre><code>$ git init -g
&gt; git init
&gt; git remote add origin git@github.com:YOUR_USER/REPO.git
</code></pre>

<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
</code></pre>

C
Chris Wanstrath 已提交
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
<h3>git browse</h3>

<pre><code>$ git browse schacon/ticgit
&gt; open http://github.com/schacon/ticgit

$ git browse -p schacon/ticgit
&gt; open http://github.com/schacon/ticgit

$ git browse resque
&gt; open http://github.com/YOUR_USER/resque

$ git browse -p resque
&gt; open https://github.com:YOUR_USER/resque
</code></pre>

215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
<h3>git compare</h3>

<pre><code>$ git compare refactor
&gt; open http://github.com/CURRENT_REPO/compare/refactor

$ git compare 1.0...1.1
&gt; open http://github.com/CURRENT_REPO/compare/1.0...1.1

$ git compare -u fix
&gt; (http://github.com/CURRENT_REPO/compare/fix)

$ git compare myfork patch
&gt; open http://github.com/myfork/compare/patch
</code></pre>

C
Chris Wanstrath 已提交
230 231 232 233 234 235 236 237
<h3>git help</h3>

<pre><code>$ git help
&gt; (improved git help)
$ git help hub
&gt; (hub man page)
</code></pre>

C
Chris Wanstrath 已提交
238 239 240 241 242 243 244 245 246 247 248 249 250 251
<h2>BUGS</h2>

<p><a href="http://github.com/defunkt/hub/issues">http://github.com/defunkt/hub/issues</a></p>

<h2>AUTHOR</h2>

<p>Chris Wanstrath :: chris@ozmm.org :: @defunkt</p>

<h2>SEE ALSO</h2>

<p>git(1), git-clone(1), git-remote(1), git-init(1),
<a href="http://github.com">http://github.com</a>,
<a href="http://github.com/defunkt/hub">http://github.com/defunkt/hub</a></p>

252

C
Chris Wanstrath 已提交
253 254
<ol class='foot man'>
  <li class='tl'>DEFUNKT</li>
C
Chris Wanstrath 已提交
255
  <li class='tc'>April 2010</li>
C
Chris Wanstrath 已提交
256 257 258 259 260 261
  <li class='tr'>hub(1)</li>
</ol>

</div>
</body>
</html>