Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 7.0.2" /> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | <style type="text/css"> |
| 8 | /* Debug borders */ |
| 9 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 10 | /* |
| 11 | border: 1px solid red; |
| 12 | */ |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | margin: 1em 5% 1em 5%; |
| 17 | } |
| 18 | |
| 19 | a { color: blue; } |
| 20 | a:visited { color: fuchsia; } |
| 21 | |
| 22 | em { |
| 23 | font-style: italic; |
| 24 | } |
| 25 | |
| 26 | strong { |
| 27 | font-weight: bold; |
| 28 | } |
| 29 | |
| 30 | tt { |
| 31 | color: navy; |
| 32 | } |
| 33 | |
| 34 | h1, h2, h3, h4, h5, h6 { |
| 35 | color: #527bbd; |
| 36 | font-family: sans-serif; |
| 37 | margin-top: 1.2em; |
| 38 | margin-bottom: 0.5em; |
| 39 | line-height: 1.3; |
| 40 | } |
| 41 | |
| 42 | h1 { |
| 43 | border-bottom: 2px solid silver; |
| 44 | } |
| 45 | h2 { |
| 46 | border-bottom: 2px solid silver; |
| 47 | padding-top: 0.5em; |
| 48 | } |
| 49 | |
| 50 | div.sectionbody { |
| 51 | font-family: serif; |
| 52 | margin-left: 0; |
| 53 | } |
| 54 | |
| 55 | hr { |
| 56 | border: 1px solid silver; |
| 57 | } |
| 58 | |
| 59 | p { |
| 60 | margin-top: 0.5em; |
| 61 | margin-bottom: 0.5em; |
| 62 | } |
| 63 | |
| 64 | pre { |
| 65 | padding: 0; |
| 66 | margin: 0; |
| 67 | } |
| 68 | |
| 69 | span#author { |
| 70 | color: #527bbd; |
| 71 | font-family: sans-serif; |
| 72 | font-weight: bold; |
| 73 | font-size: 1.2em; |
| 74 | } |
| 75 | span#email { |
| 76 | } |
| 77 | span#revision { |
| 78 | font-family: sans-serif; |
| 79 | } |
| 80 | |
| 81 | div#footer { |
| 82 | font-family: sans-serif; |
| 83 | font-size: small; |
| 84 | border-top: 2px solid silver; |
| 85 | padding-top: 0.5em; |
| 86 | margin-top: 4.0em; |
| 87 | } |
| 88 | div#footer-text { |
| 89 | float: left; |
| 90 | padding-bottom: 0.5em; |
| 91 | } |
| 92 | div#footer-badges { |
| 93 | float: right; |
| 94 | padding-bottom: 0.5em; |
| 95 | } |
| 96 | |
| 97 | div#preamble, |
| 98 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 99 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 100 | div.admonitionblock { |
| 101 | margin-right: 10%; |
| 102 | margin-top: 1.5em; |
| 103 | margin-bottom: 1.5em; |
| 104 | } |
| 105 | div.admonitionblock { |
| 106 | margin-top: 2.5em; |
| 107 | margin-bottom: 2.5em; |
| 108 | } |
| 109 | |
| 110 | div.content { /* Block element content. */ |
| 111 | padding: 0; |
| 112 | } |
| 113 | |
| 114 | /* Block element titles. */ |
| 115 | div.title, caption.title { |
| 116 | font-family: sans-serif; |
| 117 | font-weight: bold; |
| 118 | text-align: left; |
| 119 | margin-top: 1.0em; |
| 120 | margin-bottom: 0.5em; |
| 121 | } |
| 122 | div.title + * { |
| 123 | margin-top: 0; |
| 124 | } |
| 125 | |
| 126 | td div.title:first-child { |
| 127 | margin-top: 0.0em; |
| 128 | } |
| 129 | div.content div.title:first-child { |
| 130 | margin-top: 0.0em; |
| 131 | } |
| 132 | div.content + div.title { |
| 133 | margin-top: 0.0em; |
| 134 | } |
| 135 | |
| 136 | div.sidebarblock > div.content { |
| 137 | background: #ffffee; |
| 138 | border: 1px solid silver; |
| 139 | padding: 0.5em; |
| 140 | } |
| 141 | |
| 142 | div.listingblock > div.content { |
| 143 | border: 1px solid silver; |
| 144 | background: #f4f4f4; |
| 145 | padding: 0.5em; |
| 146 | } |
| 147 | |
| 148 | div.quoteblock > div.content { |
| 149 | padding-left: 2.0em; |
| 150 | } |
| 151 | div.quoteblock .attribution { |
| 152 | text-align: right; |
| 153 | } |
| 154 | |
| 155 | div.admonitionblock .icon { |
| 156 | vertical-align: top; |
| 157 | font-size: 1.1em; |
| 158 | font-weight: bold; |
| 159 | text-decoration: underline; |
| 160 | color: #527bbd; |
| 161 | padding-right: 0.5em; |
| 162 | } |
| 163 | div.admonitionblock td.content { |
| 164 | padding-left: 0.5em; |
| 165 | border-left: 2px solid silver; |
| 166 | } |
| 167 | |
| 168 | div.exampleblock > div.content { |
| 169 | border-left: 2px solid silver; |
| 170 | padding: 0.5em; |
| 171 | } |
| 172 | |
| 173 | div.verseblock div.content { |
| 174 | white-space: pre; |
| 175 | } |
| 176 | |
| 177 | div.imageblock div.content { padding-left: 0; } |
| 178 | div.imageblock img { border: 1px solid silver; } |
| 179 | span.image img { border-style: none; } |
| 180 | |
| 181 | dl { |
| 182 | margin-top: 0.8em; |
| 183 | margin-bottom: 0.8em; |
| 184 | } |
| 185 | dt { |
| 186 | margin-top: 0.5em; |
| 187 | margin-bottom: 0; |
| 188 | font-style: italic; |
| 189 | } |
| 190 | dd > *:first-child { |
| 191 | margin-top: 0; |
| 192 | } |
| 193 | |
| 194 | ul, ol { |
| 195 | list-style-position: outside; |
| 196 | } |
| 197 | ol.olist2 { |
| 198 | list-style-type: lower-alpha; |
| 199 | } |
| 200 | |
| 201 | div.tableblock > table { |
| 202 | border-color: #527bbd; |
| 203 | border-width: 3px; |
| 204 | } |
| 205 | thead { |
| 206 | font-family: sans-serif; |
| 207 | font-weight: bold; |
| 208 | } |
| 209 | tfoot { |
| 210 | font-weight: bold; |
| 211 | } |
| 212 | |
| 213 | div.hlist { |
| 214 | margin-top: 0.8em; |
| 215 | margin-bottom: 0.8em; |
| 216 | } |
| 217 | td.hlist1 { |
| 218 | vertical-align: top; |
| 219 | font-style: italic; |
| 220 | padding-right: 0.8em; |
| 221 | } |
| 222 | td.hlist2 { |
| 223 | vertical-align: top; |
| 224 | } |
| 225 | |
| 226 | @media print { |
| 227 | div#footer-badges { display: none; } |
| 228 | } |
| 229 | include::./stylesheets/xhtml11-manpage.css[] |
| 230 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 231 | |
| 232 | div.sidebar-content { |
| 233 | background: #ffffee; |
| 234 | border: 1px solid silver; |
| 235 | padding: 0.5em; |
| 236 | } |
| 237 | div.sidebar-title, div.image-title { |
| 238 | font-family: sans-serif; |
| 239 | font-weight: bold; |
| 240 | margin-top: 0.0em; |
| 241 | margin-bottom: 0.5em; |
| 242 | } |
| 243 | |
| 244 | div.listingblock div.content { |
| 245 | border: 1px solid silver; |
| 246 | background: #f4f4f4; |
| 247 | padding: 0.5em; |
| 248 | } |
| 249 | |
| 250 | div.quoteblock-content { |
| 251 | padding-left: 2.0em; |
| 252 | } |
| 253 | |
| 254 | div.exampleblock-content { |
| 255 | border-left: 2px solid silver; |
| 256 | padding-left: 0.5em; |
| 257 | } |
| 258 | </style> |
| 259 | <title>git-push(1)</title> |
| 260 | </head> |
| 261 | <body> |
| 262 | <div id="header"> |
| 263 | <h1> |
| 264 | git-push(1) Manual Page |
| 265 | </h1> |
| 266 | <h2>NAME</h2> |
| 267 | <div class="sectionbody"> |
| 268 | <p>git-push - |
Junio C Hamano | 0107892 | 2006-03-10 00:31:47 | [diff] [blame] | 269 | Update remote refs along with associated objects |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 270 | </p> |
| 271 | </div> |
| 272 | </div> |
| 273 | <h2>SYNOPSIS</h2> |
| 274 | <div class="sectionbody"> |
Junio C Hamano | a9b8d24 | 2007-05-19 04:51:55 | [diff] [blame] | 275 | <div class="verseblock"> |
| 276 | <div class="content"><em>git-push</em> [--all] [--tags] [--receive-pack=<git-receive-pack>] |
| 277 | [--repo=all] [-f | --force] [-v] [<repository> <refspec>…]</div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 278 | </div> |
| 279 | <h2>DESCRIPTION</h2> |
| 280 | <div class="sectionbody"> |
| 281 | <p>Updates remote refs using local refs, while sending objects |
| 282 | necessary to complete the given refs.</p> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 283 | <p>You can make interesting things happen to a repository |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 284 | every time you push into it, by setting up <em>hooks</em> there. See |
| 285 | documentation for <a href="git-receive-pack.html">git-receive-pack(1)</a>.</p> |
| 286 | </div> |
| 287 | <h2>OPTIONS</h2> |
| 288 | <div class="sectionbody"> |
| 289 | <dl> |
| 290 | <dt> |
| 291 | <repository> |
| 292 | </dt> |
| 293 | <dd> |
| 294 | <p> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 295 | The "remote" repository that is destination of a push |
| 296 | operation. See the section <a href="#URLS">GIT URLS</a> below. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 297 | </p> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 298 | </dd> |
| 299 | <dt> |
| 300 | <refspec> |
| 301 | </dt> |
| 302 | <dd> |
| 303 | <p> |
| 304 | The canonical format of a <refspec> parameter is |
| 305 | <tt>+?<src>:<dst></tt>; that is, an optional plus <tt>+</tt>, followed |
| 306 | by the source ref, followed by a colon <tt>:</tt>, followed by |
| 307 | the destination ref. |
| 308 | </p> |
| 309 | <p>The <src> side can be an |
| 310 | arbitrary "SHA1 expression" that can be used as an |
| 311 | argument to <tt>git-cat-file -t</tt>. E.g. <tt>master~4</tt> (push |
| 312 | four parents before the current master head).</p> |
| 313 | <p>The local ref that matches <src> is used |
| 314 | to fast forward the remote ref that matches <dst>. If |
| 315 | the optional plus <tt>+</tt> is used, the remote ref is updated |
| 316 | even if it does not result in a fast forward update.</p> |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 317 | <p>Note: If no explicit refspec is found, (that is neither |
| 318 | on the command line nor in any Push line of the |
| 319 | corresponding remotes file---see below), then all the |
| 320 | refs that exist both on the local side and on the remote |
| 321 | side are updated.</p> |
Junio C Hamano | 3f403b0 | 2006-12-13 10:14:13 | [diff] [blame] | 322 | <p><tt>tag <tag></tt> means the same as <tt>refs/tags/<tag>:refs/tags/<tag></tt>.</p> |
Junio C Hamano | 6926bef | 2007-06-16 09:54:05 | [diff] [blame] | 323 | <p>A parameter <ref> without a colon pushes the <ref> from the source |
| 324 | repository to the destination repository under the same name.</p> |
Junio C Hamano | 3f403b0 | 2006-12-13 10:14:13 | [diff] [blame] | 325 | <p>Pushing an empty <src> allows you to delete the <dst> ref from |
| 326 | the remote repository.</p> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 327 | </dd> |
| 328 | <dt> |
| 329 | --all |
| 330 | </dt> |
| 331 | <dd> |
| 332 | <p> |
| 333 | Instead of naming each ref to push, specifies that all |
| 334 | refs be pushed. |
| 335 | </p> |
| 336 | </dd> |
| 337 | <dt> |
| 338 | --tags |
| 339 | </dt> |
| 340 | <dd> |
| 341 | <p> |
| 342 | All refs under <tt>$GIT_DIR/refs/tags</tt> are pushed, in |
| 343 | addition to refspecs explicitly listed on the command |
| 344 | line. |
| 345 | </p> |
| 346 | </dd> |
| 347 | <dt> |
Junio C Hamano | 4ad294b | 2007-01-20 02:22:50 | [diff] [blame] | 348 | --receive-pack=<git-receive-pack> |
Junio C Hamano | 1ce39ab | 2007-01-16 22:05:10 | [diff] [blame] | 349 | </dt> |
| 350 | <dd> |
| 351 | <p> |
| 352 | Path to the <em>git-receive-pack</em> program on the remote |
| 353 | end. Sometimes useful when pushing to a remote |
| 354 | repository over ssh, and you do not have the program in |
| 355 | a directory on the default $PATH. |
| 356 | </p> |
| 357 | </dd> |
| 358 | <dt> |
Junio C Hamano | 4ad294b | 2007-01-20 02:22:50 | [diff] [blame] | 359 | --exec=<git-receive-pack> |
| 360 | </dt> |
| 361 | <dd> |
| 362 | <p> |
| 363 | Same as --receive-pack=<git-receive-pack>. |
| 364 | </p> |
| 365 | </dd> |
| 366 | <dt> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 367 | -f, --force |
| 368 | </dt> |
| 369 | <dd> |
| 370 | <p> |
| 371 | Usually, the command refuses to update a remote ref that is |
Junio C Hamano | 51c2ab0 | 2006-07-09 20:38:54 | [diff] [blame] | 372 | not a descendant of the local ref used to overwrite it. |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 373 | This flag disables the check. This can cause the |
| 374 | remote repository to lose commits; use it with care. |
| 375 | </p> |
| 376 | </dd> |
Junio C Hamano | 1ce39ab | 2007-01-16 22:05:10 | [diff] [blame] | 377 | <dt> |
| 378 | --repo=<repo> |
| 379 | </dt> |
| 380 | <dd> |
| 381 | <p> |
| 382 | When no repository is specified the command defaults to |
| 383 | "origin"; this overrides it. |
| 384 | </p> |
| 385 | </dd> |
| 386 | <dt> |
| 387 | --thin, --no-thin |
| 388 | </dt> |
| 389 | <dd> |
| 390 | <p> |
| 391 | These options are passed to <tt>git-send-pack</tt>. Thin |
| 392 | transfer spends extra cycles to minimize the number of |
| 393 | objects to be sent and meant to be used on slower connection. |
| 394 | </p> |
| 395 | </dd> |
| 396 | <dt> |
| 397 | -v |
| 398 | </dt> |
| 399 | <dd> |
| 400 | <p> |
| 401 | Run verbosely. |
| 402 | </p> |
| 403 | </dd> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 404 | </dl> |
| 405 | </div> |
| 406 | <h2>GIT URLS<a id="URLS"></a></h2> |
| 407 | <div class="sectionbody"> |
| 408 | <p>One of the following notations can be used |
| 409 | to name the remote repository:</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 410 | <div class="exampleblock"> |
| 411 | <div class="exampleblock-content"> |
| 412 | <ul> |
| 413 | <li> |
| 414 | <p> |
| 415 | rsync://host.xz/path/to/repo.git/ |
| 416 | </p> |
| 417 | </li> |
| 418 | <li> |
| 419 | <p> |
| 420 | http://host.xz/path/to/repo.git/ |
| 421 | </p> |
| 422 | </li> |
| 423 | <li> |
| 424 | <p> |
| 425 | https://host.xz/path/to/repo.git/ |
| 426 | </p> |
| 427 | </li> |
| 428 | <li> |
| 429 | <p> |
| 430 | git://host.xz/path/to/repo.git/ |
| 431 | </p> |
| 432 | </li> |
| 433 | <li> |
| 434 | <p> |
| 435 | git://host.xz/~user/path/to/repo.git/ |
| 436 | </p> |
| 437 | </li> |
| 438 | <li> |
| 439 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 440 | ssh://[user@]host.xz/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 441 | </p> |
| 442 | </li> |
| 443 | <li> |
| 444 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 445 | ssh://[user@]host.xz/~user/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 446 | </p> |
| 447 | </li> |
| 448 | <li> |
| 449 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 450 | ssh://[user@]host.xz/~/path/to/repo.git |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 451 | </p> |
| 452 | </li> |
| 453 | </ul> |
| 454 | </div></div> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 455 | <p>SSH is the default transport protocol. You can optionally specify |
| 456 | which user to log-in as, and an alternate, scp-like syntax is also |
| 457 | supported. Both syntaxes support username expansion, |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 458 | as does the native git protocol. The following three are |
| 459 | identical to the last three above, respectively:</p> |
| 460 | <div class="exampleblock"> |
| 461 | <div class="exampleblock-content"> |
| 462 | <ul> |
| 463 | <li> |
| 464 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 465 | [user@]host.xz:/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 466 | </p> |
| 467 | </li> |
| 468 | <li> |
| 469 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 470 | [user@]host.xz:~user/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 471 | </p> |
| 472 | </li> |
| 473 | <li> |
| 474 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 475 | [user@]host.xz:path/to/repo.git |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 476 | </p> |
| 477 | </li> |
| 478 | </ul> |
| 479 | </div></div> |
| 480 | <p>To sync with a local directory, use:</p> |
| 481 | <div class="exampleblock"> |
| 482 | <div class="exampleblock-content"> |
| 483 | <ul> |
| 484 | <li> |
| 485 | <p> |
| 486 | /path/to/repo.git/ |
| 487 | </p> |
| 488 | </li> |
| 489 | </ul> |
| 490 | </div></div> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 491 | </div> |
| 492 | <h2>REMOTES</h2> |
| 493 | <div class="sectionbody"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 494 | <p>In addition to the above, as a short-hand, the name of a |
| 495 | file in <tt>$GIT_DIR/remotes</tt> directory can be given; the |
| 496 | named file should be in the following format:</p> |
Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 497 | <div class="listingblock"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 498 | <div class="content"> |
Junio C Hamano | d3361ad | 2007-01-01 03:20:24 | [diff] [blame] | 499 | <pre><tt> URL: one of the above URL format |
| 500 | Push: <refspec> |
| 501 | Pull: <refspec> |
| 502 | </tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 503 | </div></div> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 504 | <p>Then such a short-hand is specified in place of |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 505 | <repository> without <refspec> parameters on the command |
| 506 | line, <refspec> specified on <tt>Push:</tt> lines or <tt>Pull:</tt> |
| 507 | lines are used for <tt>git-push</tt> and <tt>git-fetch</tt>/<tt>git-pull</tt>, |
Junio C Hamano | 51c2ab0 | 2006-07-09 20:38:54 | [diff] [blame] | 508 | respectively. Multiple <tt>Push:</tt> and <tt>Pull:</tt> lines may |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 509 | be specified for additional branch mappings.</p> |
Junio C Hamano | 249572f | 2006-10-24 05:44:08 | [diff] [blame] | 510 | <p>Or, equivalently, in the <tt>$GIT_DIR/config</tt> (note the use |
| 511 | of <tt>fetch</tt> instead of <tt>Pull:</tt>):</p> |
Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 512 | <div class="listingblock"> |
Junio C Hamano | 249572f | 2006-10-24 05:44:08 | [diff] [blame] | 513 | <div class="content"> |
Junio C Hamano | d3361ad | 2007-01-01 03:20:24 | [diff] [blame] | 514 | <pre><tt> [remote "<remote>"] |
| 515 | url = <url> |
| 516 | push = <refspec> |
| 517 | fetch = <refspec> |
| 518 | </tt></pre> |
Junio C Hamano | 249572f | 2006-10-24 05:44:08 | [diff] [blame] | 519 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 520 | <p>The name of a file in <tt>$GIT_DIR/branches</tt> directory can be |
| 521 | specified as an older notation short-hand; the named |
| 522 | file should contain a single line, a URL in one of the |
| 523 | above formats, optionally followed by a hash <tt>#</tt> and the |
| 524 | name of remote head (URL fragment notation). |
| 525 | <tt>$GIT_DIR/branches/<remote></tt> file that stores a <url> |
| 526 | without the fragment is equivalent to have this in the |
| 527 | corresponding file in the <tt>$GIT_DIR/remotes/</tt> directory.</p> |
Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 528 | <div class="listingblock"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 529 | <div class="content"> |
Junio C Hamano | d3361ad | 2007-01-01 03:20:24 | [diff] [blame] | 530 | <pre><tt> URL: <url> |
| 531 | Pull: refs/heads/master:<remote> |
| 532 | </tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 533 | </div></div> |
| 534 | <p>while having <tt><url>#<head></tt> is equivalent to</p> |
Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 535 | <div class="listingblock"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 536 | <div class="content"> |
Junio C Hamano | d3361ad | 2007-01-01 03:20:24 | [diff] [blame] | 537 | <pre><tt> URL: <url> |
| 538 | Pull: refs/heads/<head>:<remote></tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 539 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 540 | </div> |
Junio C Hamano | 6926bef | 2007-06-16 09:54:05 | [diff] [blame] | 541 | <h2>Examples</h2> |
| 542 | <div class="sectionbody"> |
| 543 | <dl> |
| 544 | <dt> |
| 545 | git push origin master |
| 546 | </dt> |
| 547 | <dd> |
| 548 | <p> |
| 549 | Find a ref that matches <tt>master</tt> in the source repository |
| 550 | (most likely, it would find <tt>refs/heads/master</tt>), and update |
| 551 | the same ref (e.g. <tt>refs/heads/master</tt>) in <tt>origin</tt> repository |
| 552 | with it. |
| 553 | </p> |
| 554 | </dd> |
| 555 | <dt> |
| 556 | git push origin :experimental |
| 557 | </dt> |
| 558 | <dd> |
| 559 | <p> |
| 560 | Find a ref that matches <tt>experimental</tt> in the <tt>origin</tt> repository |
| 561 | (e.g. <tt>refs/heads/experimental</tt>), and delete it. |
| 562 | </p> |
| 563 | </dd> |
| 564 | <dt> |
| 565 | git push origin master:satellite/master |
| 566 | </dt> |
| 567 | <dd> |
| 568 | <p> |
| 569 | Find a ref that matches <tt>master</tt> in the source repository |
| 570 | (most likely, it would find <tt>refs/heads/master</tt>), and update |
| 571 | the ref that matches <tt>satellite/master</tt> (most likely, it would |
| 572 | be <tt>refs/remotes/satellite/master</tt>) in <tt>origin</tt> repository with it. |
| 573 | </p> |
| 574 | </dd> |
| 575 | </dl> |
| 576 | </div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 577 | <h2>Author</h2> |
| 578 | <div class="sectionbody"> |
Junio C Hamano | 3f403b0 | 2006-12-13 10:14:13 | [diff] [blame] | 579 | <p>Written by Junio C Hamano <junkio@cox.net>, later rewritten in C |
| 580 | by Linus Torvalds <torvalds@osdl.org></p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 581 | </div> |
| 582 | <h2>Documentation</h2> |
| 583 | <div class="sectionbody"> |
| 584 | <p>Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.</p> |
| 585 | </div> |
| 586 | <h2>GIT</h2> |
| 587 | <div class="sectionbody"> |
| 588 | <p>Part of the <a href="git.html">git(7)</a> suite</p> |
| 589 | </div> |
| 590 | <div id="footer"> |
| 591 | <div id="footer-text"> |
Junio C Hamano | bb6e078 | 2007-07-19 02:14:50 | [diff] [blame] | 592 | Last updated 19-Jul-2007 02:09:49 UTC |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 593 | </div> |
| 594 | </div> |
| 595 | </body> |
| 596 | </html> |