github.com/jingweno/gh@v2.1.1-0.20221007190738-04a7985fa9a1+incompatible/man/gh.1.html (about) 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv='content-type' value='text/html;charset=utf8'> 5 <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> 6 <title>gh(1) - gh + h = github</title> 7 <style type='text/css' media='all'> 8 /* style: man */ 9 body#manpage {margin:0} 10 .mp {max-width:100ex;padding:0 9ex 1ex 4ex} 11 .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} 12 .mp h2 {margin:10px 0 0 0} 13 .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} 14 .mp h3 {margin:0 0 0 4ex} 15 .mp dt {margin:0;clear:left} 16 .mp dt.flush {float:left;width:8ex} 17 .mp dd {margin:0 0 0 9ex} 18 .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} 19 .mp pre {margin-bottom:20px} 20 .mp pre+h2,.mp pre+h3 {margin-top:22px} 21 .mp h2+pre,.mp h3+pre {margin-top:5px} 22 .mp img {display:block;margin:auto} 23 .mp h1.man-title {display:none} 24 .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} 25 .mp h2 {font-size:16px;line-height:1.25} 26 .mp h1 {font-size:20px;line-height:2} 27 .mp {text-align:justify;background:#fff} 28 .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} 29 .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} 30 .mp u {text-decoration:underline} 31 .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} 32 .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} 33 .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} 34 .mp b.man-ref {font-weight:normal;color:#434241} 35 .mp pre {padding:0 4ex} 36 .mp pre code {font-weight:normal;color:#434241} 37 .mp h2+pre,h3+pre {padding-left:0} 38 ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} 39 ol.man-decor {width:100%} 40 ol.man-decor li.tl {text-align:left} 41 ol.man-decor li.tc {text-align:center;letter-spacing:4px} 42 ol.man-decor li.tr {text-align:right;float:right} 43 </style> 44 </head> 45 <!-- 46 The following styles are deprecated and will be removed at some point: 47 div#man, div#man ol.man, div#man ol.head, div#man ol.man. 48 49 The .man-page, .man-decor, .man-head, .man-foot, .man-title, and 50 .man-navigation should be used instead. 51 --> 52 <body id='manpage'> 53 <div class='mp' id='man'> 54 55 <div class='man-navigation' style='display:none'> 56 <a href="#NAME">NAME</a> 57 <a href="#SYNOPSIS">SYNOPSIS</a> 58 <a href="#DESCRIPTION">DESCRIPTION</a> 59 <a href="#CONFIGURATION">CONFIGURATION</a> 60 <a href="#EXAMPLES">EXAMPLES</a> 61 <a href="#BUGS">BUGS</a> 62 <a href="#AUTHORS">AUTHORS</a> 63 <a href="#SEE-ALSO">SEE ALSO</a> 64 </div> 65 66 <ol class='man-decor man-head man head'> 67 <li class='tl'>gh(1)</li> 68 <li class='tc'>gh Manual</li> 69 <li class='tr'>gh(1)</li> 70 </ol> 71 72 <h2 id="NAME">NAME</h2> 73 <p class="man-name"> 74 <code>gh</code> - <span class="man-whatis">gh + h = github</span> 75 </p> 76 77 <h2 id="SYNOPSIS">SYNOPSIS</h2> 78 79 <p><code>gh</code> [<code>--noop</code>] <var>COMMAND</var> <var>OPTIONS</var><br /> 80 <code>gh alias</code> [<code>-s</code>] [<var>SHELL</var>]</p> 81 82 <h3 id="Expanded-git-commands-">Expanded git commands:</h3> 83 84 <p><code>git init -g</code> <var>OPTIONS</var><br /> 85 <code>git clone</code> [<code>-p</code>] <var>OPTIONS</var> [<var>USER</var>/]<var>REPOSITORY</var> <var>DIRECTORY</var><br /> 86 <code>git remote add</code> [<code>-p</code>] <var>OPTIONS</var> <var>USER</var>[/<var>REPOSITORY</var>]<br /> 87 <code>git remote set-url</code> [<code>-p</code>] <var>OPTIONS</var> <var>REMOTE-NAME</var> <var>USER</var>[/<var>REPOSITORY</var>]<br /> 88 <code>git fetch</code> <var>USER-1</var>,[<var>USER-2</var>,...]<br /> 89 <code>git checkout</code> <var>PULLREQ-URL</var> [<var>BRANCH</var>]<br /> 90 <code>git merge</code> <var>PULLREQ-URL</var><br /> 91 <code>git cherry-pick</code> <var>GITHUB-REF</var><br /> 92 <code>git am</code> <var>GITHUB-URL</var><br /> 93 <code>git apply</code> <var>GITHUB-URL</var><br /> 94 <code>git push</code> <var>REMOTE-1</var>,<var>REMOTE-2</var>,...,<var>REMOTE-N</var> [<var>REF</var>]<br /> 95 <code>git submodule add</code> [<code>-p</code>] <var>OPTIONS</var> [<var>USER</var>/]<var>REPOSITORY</var> <var>DIRECTORY</var></p> 96 97 <h3 id="Custom-git-commands-">Custom git commands:</h3> 98 99 <p><code>git create</code> [<var>NAME</var>] [<code>-p</code>] [<code>-d</code> <var>DESCRIPTION</var>] [<code>-h</code> <var>HOMEPAGE</var>]<br /> 100 <code>git browse</code> [<code>-u</code>] [[<var>USER</var><code>/</code>]<var>REPOSITORY</var>] [SUBPAGE]<br /> 101 <code>git compare</code> [<code>-u</code>] [<var>USER</var>] [[<var>START</var>...]<var>END</var>]<br /> 102 <code>git fork</code> [<code>--no-remote</code>]<br /> 103 <code>git pull-request</code> [<code>-f</code>] [<code>-m</code> <var>MESSAGE</var>|<code>-F</code> <var>FILE</var>|<code>-i</code> <var>ISSUE</var>|<var>ISSUE-URL</var>] [<code>-b</code> <var>BASE</var>] [<code>-h</code> <var>HEAD</var>]<br /> 104 <code>git release create</code> [<code>-d</code>] [<code>-p</code>] [<code>-a</code> <var>ASSETS-DIR</var>] [<code>-m</code> <var>MESSAGE</var>|<code>-f</code> <var>FILE</var>] <var>TAG</var> 105 <code>git issue create</code> [<code>-m</code> <var>MESSAGE</var>|<code>-f</code> <var>FILE</var>] [<code>-l</code> <var>LABEL-1</var>,<var>LABEL-2</var>,...,<var>LABEL-N</var>] 106 <code>git ci-status</code> [<code>-v</code>] [<var>COMMIT</var>]</p> 107 108 <h2 id="DESCRIPTION">DESCRIPTION</h2> 109 110 <p>gh enhances various git commands to ease most common workflows with GitHub.</p> 111 112 <dl> 113 <dt><code>gh --noop</code> <var>COMMAND</var></dt><dd><p>Shows which command(s) would be run as a result of the current command. 114 Doesn't perform anything.</p></dd> 115 <dt><code>gh alias</code> [<code>-s</code>] [<var>SHELL</var>]</dt><dd><p>Shows shell instructions for wrapping git. If given, <var>SHELL</var> specifies the 116 type of shell; otherwise defaults to the value of SHELL environment 117 variable. With <code>-s</code>, outputs shell script suitable for <code>eval</code>.</p></dd> 118 <dt><code>git init</code> <code>-g</code> <var>OPTIONS</var></dt><dd><p>Create a git repository as with <span class="man-ref">git-init<span class="s">(1)</span></span> and add remote <code>origin</code> at 119 "git@github.com:<var>USER</var>/<var>REPOSITORY</var>.git"; <var>USER</var> is your GitHub username and 120 <var>REPOSITORY</var> is the current working directory's basename.</p></dd> 121 <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 122 <var>DIRECTORY</var> as with <span class="man-ref">git-clone<span class="s">(1)</span></span>. When <var>USER</var>/ is omitted, assumes 123 your GitHub login.</p> 124 125 <p>If the repository is private or the current user has push access to the 126 repository, gh will use the ssh protocol for cloning. Use <code>-p</code> to select 127 the ssh protocol unconditionally. HTTPS protocol can be used instead by 128 setting "gh.protocol" (see <var>CONFIGURATION</var>).</p></dd> 129 <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 130 <span class="man-ref">git-remote<span class="s">(1)</span></span>. When /<var>REPOSITORY</var> is omitted, the basename of the 131 current working directory is used. With <code>-p</code>, use private remote 132 "git@github.com:<var>USER</var>/<var>REPOSITORY</var>.git". If <var>USER</var> is "origin" 133 then uses your GitHub login.</p></dd> 134 <dt><code>git remote set-url</code> [<code>-p</code>] <var>OPTIONS</var> <var>REMOTE-NAME</var> <var>USER</var>[/<var>REPOSITORY</var>]</dt><dd><p>Sets the url of remote <var>REMOTE-NAME</var> using the same rules as 135 <code>git remote add</code>.</p></dd> 136 <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 137 remotes are only added if they correspond to valid forks on GitHub.</p></dd> 138 <dt><code>git checkout</code> <var>PULLREQ-URL</var> [<var>BRANCH</var>]</dt><dd><p>Checks out the head of the pull request as a local branch, to allow for 139 reviewing, rebasing and otherwise cleaning up the commits in the pull 140 request before merging. The name of the local branch can explicitly be 141 set with <var>BRANCH</var>.</p></dd> 142 <dt><code>git merge</code> <var>PULLREQ-URL</var></dt><dd><p>Merge the pull request with a commit message that includes the pull request 143 ID and title, similar to the GitHub Merge Button.</p></dd> 144 <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 145 or GitHub-flavored Markdown notation, which is <code>user@sha</code>. If the remote 146 doesn't yet exist, it will be added. A <code>git fetch <user></code> is issued 147 prior to the cherry-pick attempt.</p></dd> 148 <dt><code>git [am|apply]</code> <var>GITHUB-URL</var></dt><dd><p>Downloads the patch file for the pull request or commit at the URL and 149 applies that patch from disk with <code>git am</code> or <code>git apply</code>. Similar to 150 <code>cherry-pick</code>, but doesn't add new remotes. <code>git am</code> creates commits while 151 preserving authorship info while <code>apply</code> only applies the patch to the 152 working copy.</p></dd> 153 <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 154 multiple <code>git push</code> commands.</p></dd> 155 <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 156 <var>DIRECTORY</var> as with <span class="man-ref">git-submodule<span class="s">(1)</span></span>. When <var>USER</var>/ is omitted, assumes 157 your GitHub login. With <code>-p</code>, use private remote 158 "git@github.com:<var>USER</var>/<var>REPOSITORY</var>.git".</p></dd> 159 <dt><code>git help</code></dt><dd><p>Display enhanced <span class="man-ref">git-help<span class="s">(1)</span></span>.</p></dd> 160 </dl> 161 162 163 <p>gh also adds some custom commands that are otherwise not present in git:</p> 164 165 <dl> 166 <dt><code>git create</code> [<var>NAME</var>] [<code>-p</code>] [<code>-d</code> <var>DESCRIPTION</var>] [<code>-h</code> <var>HOMEPAGE</var>]</dt><dd><p>Create a new public GitHub repository from the current git 167 repository and add remote <code>origin</code> at 168 "git@github.com:<var>USER</var>/<var>REPOSITORY</var>.git"; <var>USER</var> is your GitHub 169 username and <var>REPOSITORY</var> is the current working directory name. 170 To explicitly name the new repository, pass in <var>NAME</var>, optionally in 171 <var>ORGANIZATION</var>/<var>NAME</var> form to create under an organization you're a 172 member of. With <code>-p</code>, create a private repository, and with <code>-d</code> and <code>-h</code> 173 set the repository's description and homepage URL, respectively.</p></dd> 174 <dt><code>git browse</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 175 <code>open(1)</code> or the <code>BROWSER</code> env variable. If the repository isn't 176 specified, <code>browse</code> opens the page of the repository found in the current 177 directory. If SUBPAGE is specified, the browser will open on the specified 178 subpage: one of "wiki", "commits", "issues" or other (the default is 179 "tree"). With <code>-u</code>, outputs the URL rather than opening the browser.</p></dd> 180 <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. 181 <var>START</var> to <var>END</var> are branch names, tag names, or commit SHA1s specifying 182 the range of history to compare. If a range with two dots (<code>a..b</code>) is given, 183 it will be transformed into one with three dots. If <var>START</var> is omitted, 184 GitHub will compare against the base branch (the default is "master"). 185 If <var>END</var> is omitted, GitHub compare view is opened for the current branch. 186 With <code>-u</code>, outputs the URL rather than opening the browser.</p></dd> 187 <dt><code>git fork</code> [<code>--no-remote</code>]</dt><dd><p>Forks the original project (referenced by "origin" remote) on GitHub and 188 adds a new remote for it under your username.</p></dd> 189 <dt><code>git pull-request</code> [<code>-f</code>] [<code>-m</code> <var>MESSAGE</var>|<code>-F</code> <var>FILE</var>|<code>-i</code> <var>ISSUE</var>|<var>ISSUE-URL</var>] [<code>-b</code> <var>BASE</var>] [<code>-h</code> <var>HEAD</var>]</dt><dd><p>Opens a pull request on GitHub for the project that the "origin" remote 190 points to. The default head of the pull request is the current branch. 191 Both base and head of the pull request can be explicitly given in one of 192 the following formats: "branch", "owner:branch", "owner/repo:branch". 193 This command will abort operation if it detects that the current topic 194 branch has local commits that are not yet pushed to its upstream branch 195 on the remote. To skip this check, use <code>-f</code>.</p> 196 197 <p>Without <var>MESSAGE</var> or <var>FILE</var>, a text editor will open in which title and body 198 of the pull request can be entered in the same manner as git commit message. 199 Pull request message can also be passed via stdin with <code>-F -</code>.</p> 200 201 <p>Issue to pull request conversion via <code>-i <ISSUE></code> or <var>ISSUE-URL</var> 202 arguments is deprecated and will likely be removed from the future versions 203 of both hub and GitHub API.</p></dd> 204 <dt><code>git release</code></dt><dd><p>Retrieves releases from GitHub for the project that the "origin" remote 205 points to.</p></dd> 206 <dt><code>git release create</code> [<code>-d</code>] [<code>-p</code>] [<code>-a</code> <var>ASSETS-DIR</var>] [<code>-m</code> <var>MESSAGE</var>|<code>-f</code> <var>FILE</var>] <var>TAG</var></dt><dd><p>Creates a new release in GitHub for the project that the "origin" remote 207 points to. It requires the name of the tag to release as a first argument.</p> 208 209 <p>Specify the assets to include in the release from a directory via <code>-a</code>. Without 210 <code>-a</code>, it finds assets from "releases/TAG" of the current directory.</p> 211 212 <p>Without <var>MESSAGE</var> or <var>FILE</var>, a text editor will open in which title and body 213 of the release can be entered in the same manner as git commit message.</p> 214 215 <p>If <code>-d</code> is given, it creates a draft release.</p> 216 217 <p>If <code>-p</code> is given, it creates a pre-release.</p></dd> 218 <dt><code>git issue</code></dt><dd><p>List summary of the open issues for the project that the "origin" remote 219 points to.</p></dd> 220 <dt><code>git issue create</code> [<code>-m</code> <var>MESSAGE</var>|<code>-f</code> <var>FILE</var>] [<code>-l</code> <var>LABEL-1</var>,<var>LABEL-2</var>,...,<var>LABEL-N</var>]</dt><dd><p>Creates an issue for the project that the "origin" remote points to.</p> 221 222 <p>Without <var>MESSAGE</var> or <var>FILE</var>, a text editor will open in which title and body 223 of the release can be entered in the same manner as git commit message.</p> 224 225 <p>Specify one or more labels via <code>-a</code>.</p></dd> 226 <dt><code>git ci-status</code> [<code>-v</code>] [<var>COMMIT</var>]</dt><dd><p>Looks up the SHA for <var>COMMIT</var> in GitHub Status API and displays the latest 227 status. Exits with one of:<br /> 228 success (0), error (1), failure (1), pending (2), no status (3)</p> 229 230 <p>If <code>-v</code> is given, additionally print the URL to CI build results.</p></dd> 231 </dl> 232 233 234 <h2 id="CONFIGURATION">CONFIGURATION</h2> 235 236 <p>gh will prompt for GitHub username & password the first time it needs to access 237 the API and exchange it for an OAuth token, which it saves in "~/.config/gh".</p> 238 239 <p>To avoid being prompted, use <var>GITHUB_USER</var> and <var>GITHUB_PASSWORD</var> environment 240 variables.</p> 241 242 <p>If you prefer the HTTPS protocol for GitHub repositories, you can set 243 "gh.protocol" to "https". This will affect <code>clone</code>, <code>fork</code>, <code>remote add</code> 244 and other operations that expand references to GitHub repositories as full 245 URLs that otherwise use git and ssh protocols.</p> 246 247 <pre><code>$ git config --global gh.protocol https 248 </code></pre> 249 250 <h3 id="GitHub-Enterprise">GitHub Enterprise</h3> 251 252 <p>By default, gh will only work with repositories that have remotes which 253 point to github.com. GitHub Enterprise hosts need to be whitelisted to 254 configure hub to treat such remotes same as github.com:</p> 255 256 <pre><code>$ git config --global --add gh.host my.git.org 257 </code></pre> 258 259 <p>The default host for commands like <code>init</code> and <code>clone</code> is still 260 github.com, but this can be affected with the <var>GITHUB_HOST</var> environment 261 variable:</p> 262 263 <pre><code>$ GITHUB_HOST=my.git.org git clone myproject 264 </code></pre> 265 266 <h2 id="EXAMPLES">EXAMPLES</h2> 267 268 <h3 id="git-init">git init</h3> 269 270 <pre><code>$ git init -g 271 > git init 272 > git remote add origin git@github.com:YOUR_USER/REPO.git 273 </code></pre> 274 275 <h3 id="git-push">git push</h3> 276 277 <pre><code>$ git push origin,staging,qa bert_timeout 278 > git push origin bert_timeout 279 > git push staging bert_timeout 280 > git push qa bert_timeout 281 282 $ git push origin 283 > git push origin HEAD 284 </code></pre> 285 286 <h3 id="git-checkout">git checkout</h3> 287 288 <pre><code>$ git checkout https://github.com/jingweno/gh/pull/35 289 > git remote add -f -t feature git://github:com/foo/gh.git 290 > git checkout --track -B foo-feature foo/feature 291 292 $ git checkout https://github.com/jingweno/gh/pull/35 custom-branch-name 293 </code></pre> 294 295 <h3 id="git-merge">git merge</h3> 296 297 <pre><code>$ git merge https://github.com/jingweno/gh/pull/73 298 > git fetch git://github.com/jingweno/gh.git +refs/heads/feature:refs/remotes/jingweno/feature 299 > git merge jingweno/feature --no-ff -m 'Merge pull request #73 from jingweno/feature...' 300 </code></pre> 301 302 <h3 id="git-clone">git clone</h3> 303 304 <pre><code>$ git clone jingweno/gh 305 > git clone git://github.com/jingweno/gh 306 307 $ git clone -p jingweno/gh 308 > git clone git@github.com:jingweno/gh.git 309 310 $ git clone jekyll_and_hype 311 > git clone git://github.com/YOUR_LOGIN/jekyll_and_hype. 312 313 $ git clone -p jekyll_and_hype 314 > git clone git@github.com:YOUR_LOGIN/jekyll_and_hype.git 315 </code></pre> 316 317 <h3 id="git-fetch">git fetch</h3> 318 319 <pre><code>$ git fetch jingweno 320 > git remote add jingweno git://github.com/jingweno/REPO.git 321 > git fetch jingweno 322 323 $ git fetch jingweno,foo 324 > git remote add jingweno ... 325 > git remote add foo ... 326 > git fetch --multiple jingweno foo 327 328 $ git fetch --multiple jingweno foo 329 > git remote add jingweno ... 330 > git remote add foo ... 331 > git fetch --multiple jingweno foo 332 </code></pre> 333 334 <h3 id="git-cherry-pick">git cherry-pick</h3> 335 336 <pre><code>$ git cherry-pick https://github.com/jingweno/gh/commit/a319d88#comments 337 > git remote add -f jingweno git://github.com/jingweno/gh.git 338 > git cherry-pick a319d88 339 340 $ git cherry-pick jingweno@a319d88 341 > git remote add -f jingweno git://github.com/jingweno/gh.git 342 > git cherry-pick a319d88 343 344 $ git cherry-pick jingweno@SHA 345 > git fetch jingweno 346 > git cherry-pick SHA 347 </code></pre> 348 349 <h3 id="git-remote">git remote</h3> 350 351 <pre><code>$ git remote add jingweno 352 > git remote add -f jingweno git://github.com/jingweno/CURRENT_REPO.git 353 354 $ git remote add -p jingweno 355 > git remote add -f jingweno git@github.com:jingweno/CURRENT_REPO.git 356 357 $ git remote add origin 358 > git remote add -f YOUR_USER git://github.com/YOUR_USER/CURRENT_REPO.git 359 </code></pre> 360 361 <h3 id="git-submodule">git submodule</h3> 362 363 <pre><code>$ git submodule add jingweno/gh vendor/gh 364 > git submodule add git://github.com/jingweno/gh.git vendor/gh 365 366 $ git submodule add -p jingweno/gh vendor/gh 367 > git submodule add git@github.com:jingweno/gh.git vendor/gh 368 369 $ git submodule add -b gh --name gh jingweno/gh vendor/gh 370 > git submodule add -b gh --name gh git://github.com/jingweno/gh.git vendor/gh 371 </code></pre> 372 373 <h3 id="git-pull-request">git pull-request</h3> 374 375 <pre><code># while on a topic branch called "feature": 376 $ git pull-request 377 [ opens text editor to edit title & body for the request ] 378 [ opened pull request on GitHub for "YOUR_USER:feature" ] 379 380 # explicit pull base & head: 381 $ git pull-request -b jingweno:master -h jingweno:feature 382 383 $ git pull-request -m "title\n\nbody" 384 [ create pull request with title & body ] 385 386 $ git pull-request -i 123 387 [ attached pull request to issue #123 ] 388 389 $ git pull-request https://github.com/jingweno/gh/pull/123 390 [ attached pull request to issue #123 ] 391 392 $ git pull-request -F FILE 393 [ create pull request with title & body from FILE ] 394 </code></pre> 395 396 <h3 id="git-apply">git apply</h3> 397 398 <pre><code>$ git apply https://github.com/jingweno/gh/pull/55 399 > curl https://github.com/jingweno/gh/pull/55.patch -o /tmp/55.patch 400 > git apply /tmp/55.patch 401 402 $ git apply --ignore-whitespace https://github.com/jingweno/gh/commit/fdb9921 403 > curl https://github.com/jingweno/gh/commit/fdb9921.patch -o /tmp/fdb9921.patch 404 > git apply --ignore-whitespace /tmp/fdb9921.patch 405 406 $ git apply https://gist.github.com/8da7fb575debd88c54cf 407 > curl https://gist.github.com/8da7fb575debd88c54cf.txt -o /tmp/gist-8da7fb575debd88c54cf.txt 408 > git apply /tmp/gist-8da7fb575debd88c54cf.txt 409 </code></pre> 410 411 <h3 id="git-fork">git fork</h3> 412 413 <pre><code>$ git fork 414 [ repo forked on GitHub ] 415 > git remote add -f YOUR_USER git@github.com:YOUR_USER/CURRENT_REPO.git 416 417 $ git fork --no-remote 418 [ repo forked on GitHub ] 419 </code></pre> 420 421 <h3 id="git-create">git create</h3> 422 423 <pre><code>$ git create 424 ... create repo on github ... 425 > git remote add -f origin git@github.com:YOUR_USER/CURRENT_REPO.git 426 427 # with description: 428 $ git create -d 'It shall be mine, all mine!' 429 430 $ git create recipes 431 [ repo created on GitHub ] 432 > git remote add origin git@github.com:YOUR_USER/recipes.git 433 434 $ git create sinatra/recipes 435 [ repo created in GitHub organization ] 436 > git remote add origin git@github.com:sinatra/recipes.git 437 </code></pre> 438 439 <h3 id="git-ci-status">git ci-status</h3> 440 441 <pre><code>$ git ci-status 442 > (prints CI state of HEAD and exits with appropriate code) 443 > One of: success (0), error (1), failure (1), pending (2), no status (3) 444 445 $ git ci-status -v 446 > (prints CI state of HEAD, the URL to the CI build results and exits with appropriate code) 447 > One of: success (0), error (1), failure (1), pending (2), no status (3) 448 449 $ git ci-status BRANCH 450 > (prints CI state of BRANCH and exits with appropriate code) 451 > One of: success (0), error (1), failure (1), pending (2), no status (3) 452 453 $ git ci-status SHA 454 > (prints CI state of SHA and exits with appropriate code) 455 > One of: success (0), error (1), failure (1), pending (2), no status (3) 456 </code></pre> 457 458 <h3 id="git-browse">git browse</h3> 459 460 <pre><code>$ git browse 461 > open https://github.com/YOUR_USER/CURRENT_REPO 462 463 $ git browse commit/SHA 464 > open https://github.com/YOUR_USER/CURRENT_REPO/commit/SHA 465 466 $ git browse issues 467 > open https://github.com/YOUR_USER/CURRENT_REPO/issues 468 469 $ git browse -p jingweno/gh 470 > open https://github.com/jingweno/gh 471 472 $ git browse -p jingweno/gh commit/SHA 473 > open https://github.com/jingweno/gh/commit/SHA 474 475 $ git browse -p resque 476 > open https://github.com/YOUR_USER/resque 477 478 $ git browse -p resque network 479 > open https://github.com/YOUR_USER/resque/network 480 </code></pre> 481 482 <h3 id="git-compare">git compare</h3> 483 484 <pre><code>$ git compare refactor 485 > open https://github.com/CURRENT_REPO/compare/refactor 486 487 $ git compare 1.0..1.1 488 > open https://github.com/CURRENT_REPO/compare/1.0...1.1 489 490 $ git compare -u other-user patch 491 > open https://github.com/other-user/REPO/compare/patch 492 </code></pre> 493 494 <h3 id="git-release-beta-">git release (beta)</h3> 495 496 <pre><code>$ git release 497 > (prints a list of releases of YOUR_USER/CURRENT_REPO) 498 499 $ git release TAG 500 > (creates a new release for the given tag) 501 </code></pre> 502 503 <h3 id="git-issues-beta-">git issues (beta)</h3> 504 505 <pre><code>$ git issue 506 > (prints a list of issues for YOUR_USER/CURRENT_REPO) 507 508 $ git issue create 509 > (creates an issue for the project that "origin" remte points to) 510 </code></pre> 511 512 <h2 id="BUGS">BUGS</h2> 513 514 <p><a href="https://github.com/github/gh/issues" data-bare-link="true">https://github.com/github/gh/issues</a></p> 515 516 <h2 id="AUTHORS">AUTHORS</h2> 517 518 <p><a href="https://github.com/github/gh/contributors" data-bare-link="true">https://github.com/github/gh/contributors</a></p> 519 520 <h2 id="SEE-ALSO">SEE ALSO</h2> 521 522 <p><span class="man-ref">git<span class="s">(1)</span></span>, <span class="man-ref">git-clone<span class="s">(1)</span></span>, <span class="man-ref">git-remote<span class="s">(1)</span></span>, <span class="man-ref">git-init<span class="s">(1)</span></span>, 523 <a href="http://github.com" data-bare-link="true">http://github.com</a>, 524 <a href="https://github.com/github/hub" data-bare-link="true">https://github.com/github/hub</a></p> 525 526 527 <ol class='man-decor man-foot man foot'> 528 <li class='tl'>GITHUB</li> 529 <li class='tc'>January 2014</li> 530 <li class='tr'>gh(1)</li> 531 </ol> 532 533 </div> 534 </body> 535 </html>