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"> |
Junio C Hamano | 764a667 | 2007-10-23 01:23:31 | [diff] [blame] | 276 | <div class="content"><em>git-push</em> [--all] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>] |
Junio C Hamano | 3cc1739 | 2007-11-12 04:27:07 | [diff] [blame] | 277 | [--repo=all] [-f | --force] [-v | --verbose] [<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> |
Junio C Hamano | a9aee78 | 2008-04-23 16:09:20 | [diff] [blame] | 309 | <p>The <src> side represents the source branch (or arbitrary |
| 310 | "SHA1 expression", such as <tt>master~4</tt> (four parents before the |
| 311 | tip of <tt>master</tt> branch); see <a href="git-rev-parse.html">git-rev-parse(1)</a>) that you |
| 312 | want to push. The <dst> side represents the destination location.</p> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 313 | <p>The local ref that matches <src> is used |
Junio C Hamano | a9aee78 | 2008-04-23 16:09:20 | [diff] [blame] | 314 | to fast forward the remote ref that matches <dst> (or, if no <dst> was |
| 315 | specified, the same ref that <src> referred to locally). If |
| 316 | the optional leading plus <tt>+</tt> is used, the remote ref is updated |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 317 | even if it does not result in a fast forward update.</p> |
Junio C Hamano | 3f403b0 | 2006-12-13 10:14:13 | [diff] [blame] | 318 | <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] | 319 | <p>A parameter <ref> without a colon pushes the <ref> from the source |
| 320 | repository to the destination repository under the same name.</p> |
Junio C Hamano | 3f403b0 | 2006-12-13 10:14:13 | [diff] [blame] | 321 | <p>Pushing an empty <src> allows you to delete the <dst> ref from |
| 322 | the remote repository.</p> |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 323 | <p>The special refspec <tt>:</tt> (or <tt>+:</tt> to allow non-fast forward updates) |
| 324 | directs git to push "matching" heads: for every head that exists on |
| 325 | the local side, the remote side is updated if a head of the same name |
| 326 | already exists on the remote side. This is the default operation mode |
| 327 | if no explicit refspec is found (that is neither on the command line |
| 328 | nor in any Push line of the corresponding remotes file---see below).</p> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 329 | </dd> |
| 330 | <dt> |
| 331 | --all |
| 332 | </dt> |
| 333 | <dd> |
| 334 | <p> |
| 335 | Instead of naming each ref to push, specifies that all |
Junio C Hamano | d2d9ae1 | 2007-09-19 02:27:57 | [diff] [blame] | 336 | refs under <tt>$GIT_DIR/refs/heads/</tt> be pushed. |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 337 | </p> |
| 338 | </dd> |
| 339 | <dt> |
Junio C Hamano | 9d2bbb7 | 2007-11-25 04:56:07 | [diff] [blame] | 340 | --mirror |
| 341 | </dt> |
| 342 | <dd> |
| 343 | <p> |
| 344 | Instead of naming each ref to push, specifies that all |
| 345 | refs under <tt>$GIT_DIR/refs/heads/</tt> and <tt>$GIT_DIR/refs/tags/</tt> |
| 346 | be mirrored to the remote repository. Newly created local |
| 347 | refs will be pushed to the remote end, locally updated refs |
| 348 | will be force updated on the remote end, and deleted refs |
Junio C Hamano | 47d68a5 | 2008-05-06 06:35:40 | [diff] [blame] | 349 | will be removed from the remote end. This is the default |
| 350 | if the configuration option <tt>remote.<remote>.mirror</tt> is |
| 351 | set. |
Junio C Hamano | 9d2bbb7 | 2007-11-25 04:56:07 | [diff] [blame] | 352 | </p> |
| 353 | </dd> |
| 354 | <dt> |
Junio C Hamano | 764a667 | 2007-10-23 01:23:31 | [diff] [blame] | 355 | --dry-run |
| 356 | </dt> |
| 357 | <dd> |
| 358 | <p> |
| 359 | Do everything except actually send the updates. |
| 360 | </p> |
| 361 | </dd> |
| 362 | <dt> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 363 | --tags |
| 364 | </dt> |
| 365 | <dd> |
| 366 | <p> |
| 367 | All refs under <tt>$GIT_DIR/refs/tags</tt> are pushed, in |
| 368 | addition to refspecs explicitly listed on the command |
| 369 | line. |
| 370 | </p> |
| 371 | </dd> |
| 372 | <dt> |
Junio C Hamano | 4ad294b | 2007-01-20 02:22:50 | [diff] [blame] | 373 | --receive-pack=<git-receive-pack> |
Junio C Hamano | 1ce39ab | 2007-01-16 22:05:10 | [diff] [blame] | 374 | </dt> |
| 375 | <dd> |
| 376 | <p> |
| 377 | Path to the <em>git-receive-pack</em> program on the remote |
| 378 | end. Sometimes useful when pushing to a remote |
| 379 | repository over ssh, and you do not have the program in |
| 380 | a directory on the default $PATH. |
| 381 | </p> |
| 382 | </dd> |
| 383 | <dt> |
Junio C Hamano | 4ad294b | 2007-01-20 02:22:50 | [diff] [blame] | 384 | --exec=<git-receive-pack> |
| 385 | </dt> |
| 386 | <dd> |
| 387 | <p> |
| 388 | Same as --receive-pack=<git-receive-pack>. |
| 389 | </p> |
| 390 | </dd> |
| 391 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame^] | 392 | -f |
| 393 | </dt> |
| 394 | <dt> |
| 395 | --force |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 396 | </dt> |
| 397 | <dd> |
| 398 | <p> |
| 399 | Usually, the command refuses to update a remote ref that is |
Junio C Hamano | 4cd1c0e | 2007-08-06 04:39:14 | [diff] [blame] | 400 | not an ancestor of the local ref used to overwrite it. |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 401 | This flag disables the check. This can cause the |
| 402 | remote repository to lose commits; use it with care. |
| 403 | </p> |
| 404 | </dd> |
Junio C Hamano | 1ce39ab | 2007-01-16 22:05:10 | [diff] [blame] | 405 | <dt> |
| 406 | --repo=<repo> |
| 407 | </dt> |
| 408 | <dd> |
| 409 | <p> |
| 410 | When no repository is specified the command defaults to |
| 411 | "origin"; this overrides it. |
| 412 | </p> |
| 413 | </dd> |
| 414 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame^] | 415 | --thin |
| 416 | </dt> |
| 417 | <dt> |
| 418 | --no-thin |
Junio C Hamano | 1ce39ab | 2007-01-16 22:05:10 | [diff] [blame] | 419 | </dt> |
| 420 | <dd> |
| 421 | <p> |
| 422 | These options are passed to <tt>git-send-pack</tt>. Thin |
| 423 | transfer spends extra cycles to minimize the number of |
| 424 | objects to be sent and meant to be used on slower connection. |
| 425 | </p> |
| 426 | </dd> |
| 427 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame^] | 428 | -v |
| 429 | </dt> |
| 430 | <dt> |
| 431 | --verbose |
Junio C Hamano | 1ce39ab | 2007-01-16 22:05:10 | [diff] [blame] | 432 | </dt> |
| 433 | <dd> |
| 434 | <p> |
| 435 | Run verbosely. |
| 436 | </p> |
| 437 | </dd> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 438 | </dl> |
| 439 | </div> |
| 440 | <h2>GIT URLS<a id="URLS"></a></h2> |
| 441 | <div class="sectionbody"> |
| 442 | <p>One of the following notations can be used |
| 443 | to name the remote repository:</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 444 | <div class="exampleblock"> |
| 445 | <div class="exampleblock-content"> |
| 446 | <ul> |
| 447 | <li> |
| 448 | <p> |
| 449 | rsync://host.xz/path/to/repo.git/ |
| 450 | </p> |
| 451 | </li> |
| 452 | <li> |
| 453 | <p> |
| 454 | http://host.xz/path/to/repo.git/ |
| 455 | </p> |
| 456 | </li> |
| 457 | <li> |
| 458 | <p> |
| 459 | https://host.xz/path/to/repo.git/ |
| 460 | </p> |
| 461 | </li> |
| 462 | <li> |
| 463 | <p> |
| 464 | git://host.xz/path/to/repo.git/ |
| 465 | </p> |
| 466 | </li> |
| 467 | <li> |
| 468 | <p> |
| 469 | git://host.xz/~user/path/to/repo.git/ |
| 470 | </p> |
| 471 | </li> |
| 472 | <li> |
| 473 | <p> |
Junio C Hamano | dbb6459 | 2007-09-01 11:17:39 | [diff] [blame] | 474 | ssh://[user@]host.xz[:port]/path/to/repo.git/ |
| 475 | </p> |
| 476 | </li> |
| 477 | <li> |
| 478 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 479 | ssh://[user@]host.xz/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 480 | </p> |
| 481 | </li> |
| 482 | <li> |
| 483 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 484 | ssh://[user@]host.xz/~user/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 485 | </p> |
| 486 | </li> |
| 487 | <li> |
| 488 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 489 | ssh://[user@]host.xz/~/path/to/repo.git |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 490 | </p> |
| 491 | </li> |
| 492 | </ul> |
| 493 | </div></div> |
Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 494 | <p>SSH is the default transport protocol over the network. You can |
| 495 | optionally specify which user to log-in as, and an alternate, |
| 496 | scp-like syntax is also supported. Both syntaxes support |
Junio C Hamano | dbb6459 | 2007-09-01 11:17:39 | [diff] [blame] | 497 | username expansion, as does the native git protocol, but |
| 498 | only the former supports port specification. The following |
Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 499 | three are identical to the last three above, respectively:</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 500 | <div class="exampleblock"> |
| 501 | <div class="exampleblock-content"> |
| 502 | <ul> |
| 503 | <li> |
| 504 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 505 | [user@]host.xz:/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 506 | </p> |
| 507 | </li> |
| 508 | <li> |
| 509 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 510 | [user@]host.xz:~user/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 511 | </p> |
| 512 | </li> |
| 513 | <li> |
| 514 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 515 | [user@]host.xz:path/to/repo.git |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 516 | </p> |
| 517 | </li> |
| 518 | </ul> |
| 519 | </div></div> |
Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 520 | <p>To sync with a local directory, you can use:</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 521 | <div class="exampleblock"> |
| 522 | <div class="exampleblock-content"> |
| 523 | <ul> |
| 524 | <li> |
| 525 | <p> |
| 526 | /path/to/repo.git/ |
| 527 | </p> |
| 528 | </li> |
Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 529 | <li> |
| 530 | <p> |
| 531 | file:///path/to/repo.git/ |
| 532 | </p> |
| 533 | </li> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 534 | </ul> |
| 535 | </div></div> |
Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 536 | <p>They are mostly equivalent, except when cloning. See |
| 537 | <a href="git-clone.html">git-clone(1)</a> for details.</p> |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 538 | <p>If there are a large number of similarly-named remote repositories and |
| 539 | you want to use a different format for them (such that the URLs you |
| 540 | use will be rewritten into URLs that work), you can create a |
| 541 | configuration section of the form:</p> |
| 542 | <div class="listingblock"> |
| 543 | <div class="content"> |
| 544 | <pre><tt> [url "<actual url base>"] |
| 545 | insteadOf = <other url base></tt></pre> |
| 546 | </div></div> |
| 547 | <p>For example, with this:</p> |
| 548 | <div class="listingblock"> |
| 549 | <div class="content"> |
| 550 | <pre><tt> [url "git://git.host.xz/"] |
| 551 | insteadOf = host.xz:/path/to/ |
| 552 | insteadOf = work:</tt></pre> |
| 553 | </div></div> |
| 554 | <p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be |
| 555 | rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 556 | </div> |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 557 | <h2>REMOTES<a id="REMOTES"></a></h2> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 558 | <div class="sectionbody"> |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 559 | <p>The name of one of the following can be used instead |
| 560 | of a URL as <tt><repository></tt> argument:</p> |
| 561 | <ul> |
| 562 | <li> |
| 563 | <p> |
| 564 | a remote in the git configuration file: <tt>$GIT_DIR/config</tt>, |
| 565 | </p> |
| 566 | </li> |
| 567 | <li> |
| 568 | <p> |
| 569 | a file in the <tt>$GIT_DIR/remotes</tt> directory, or |
| 570 | </p> |
| 571 | </li> |
| 572 | <li> |
| 573 | <p> |
| 574 | a file in the <tt>$GIT_DIR/branches</tt> directory. |
| 575 | </p> |
| 576 | </li> |
| 577 | </ul> |
| 578 | <p>All of these also allow you to omit the refspec from the command line |
| 579 | because they each contain a refspec which git will use by default.</p> |
| 580 | <h3>Named remote in configuration file</h3> |
| 581 | <p>You can choose to provide the name of a remote which you had previously |
| 582 | configured using <a href="git-remote.html">git-remote(1)</a>, <a href="git-config.html">git-config(1)</a> |
| 583 | or even by a manual edit to the <tt>$GIT_DIR/config</tt> file. The URL of |
| 584 | this remote will be used to access the repository. The refspec |
| 585 | of this remote will be used by default when you do |
| 586 | not provide a refspec on the command line. The entry in the |
| 587 | config file would appear like this:</p> |
| 588 | <div class="listingblock"> |
| 589 | <div class="content"> |
| 590 | <pre><tt> [remote "<name>"] |
| 591 | url = <url> |
| 592 | push = <refspec> |
| 593 | fetch = <refspec></tt></pre> |
| 594 | </div></div> |
| 595 | <h3>Named file in <tt>$GIT_DIR/remotes</tt></h3> |
| 596 | <p>You can choose to provide the name of a |
| 597 | file in <tt>$GIT_DIR/remotes</tt>. The URL |
| 598 | in this file will be used to access the repository. The refspec |
| 599 | in this file will be used as default when you do not |
| 600 | provide a refspec on the command line. This file should have the |
| 601 | following format:</p> |
Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 602 | <div class="listingblock"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 603 | <div class="content"> |
Junio C Hamano | d3361ad | 2007-01-01 03:20:24 | [diff] [blame] | 604 | <pre><tt> URL: one of the above URL format |
| 605 | Push: <refspec> |
| 606 | Pull: <refspec> |
| 607 | </tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 608 | </div></div> |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 609 | <p><tt>Push:</tt> lines are used by <tt>git-push</tt> and |
| 610 | <tt>Pull:</tt> lines are used by <tt>git-pull</tt> and <tt>git-fetch</tt>. |
| 611 | Multiple <tt>Push:</tt> and <tt>Pull:</tt> lines may |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 612 | be specified for additional branch mappings.</p> |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 613 | <h3>Named file in <tt>$GIT_DIR/branches</tt></h3> |
| 614 | <p>You can choose to provide the name of a |
| 615 | file in <tt>$GIT_DIR/branches</tt>. |
| 616 | The URL in this file will be used to access the repository. |
| 617 | This file should have the following format:</p> |
Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 618 | <div class="listingblock"> |
Junio C Hamano | 249572f | 2006-10-24 05:44:08 | [diff] [blame] | 619 | <div class="content"> |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 620 | <pre><tt> <url>#<head></tt></pre> |
Junio C Hamano | 249572f | 2006-10-24 05:44:08 | [diff] [blame] | 621 | </div></div> |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 622 | <p><tt><url></tt> is required; <tt>#<head></tt> is optional. |
| 623 | When you do not provide a refspec on the command line, |
| 624 | git will use the following refspec, where <tt><head></tt> defaults to <tt>master</tt>, |
| 625 | and <tt><repository></tt> is the name of this file |
| 626 | you provided in the command line.</p> |
Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 627 | <div class="listingblock"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 628 | <div class="content"> |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 629 | <pre><tt> refs/heads/<head>:<repository></tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 630 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 631 | </div> |
Junio C Hamano | 6d559fc | 2008-02-20 10:44:26 | [diff] [blame] | 632 | <h2>OUTPUT</h2> |
| 633 | <div class="sectionbody"> |
| 634 | <p>The output of "git push" depends on the transport method used; this |
| 635 | section describes the output when pushing over the git protocol (either |
| 636 | locally or via ssh).</p> |
| 637 | <p>The status of the push is output in tabular form, with each line |
| 638 | representing the status of a single ref. Each line is of the form:</p> |
| 639 | <div class="listingblock"> |
| 640 | <div class="content"> |
| 641 | <pre><tt> <flag> <summary> <from> -> <to> (<reason>)</tt></pre> |
| 642 | </div></div> |
| 643 | <dl> |
| 644 | <dt> |
| 645 | flag |
| 646 | </dt> |
| 647 | <dd> |
| 648 | <p> |
| 649 | A single character indicating the status of the ref. This is |
| 650 | blank for a successfully pushed ref, <tt>!</tt> for a ref that was |
| 651 | rejected or failed to push, and <em>=</em> for a ref that was up to |
| 652 | date and did not need pushing (note that the status of up to |
| 653 | date refs is shown only when <tt>git push</tt> is running verbosely). |
| 654 | </p> |
| 655 | </dd> |
| 656 | <dt> |
| 657 | summary |
| 658 | </dt> |
| 659 | <dd> |
| 660 | <p> |
| 661 | For a successfully pushed ref, the summary shows the old and new |
| 662 | values of the ref in a form suitable for using as an argument to |
| 663 | <tt>git log</tt> (this is <tt><old>..<new></tt> in most cases, and |
| 664 | <tt><old>…<new></tt> for forced non-fast forward updates). For a |
| 665 | failed update, more details are given for the failure. |
| 666 | The string <tt>rejected</tt> indicates that git did not try to send the |
| 667 | ref at all (typically because it is not a fast forward). The |
| 668 | string <tt>remote rejected</tt> indicates that the remote end refused |
| 669 | the update; this rejection is typically caused by a hook on the |
| 670 | remote side. The string <tt>remote failure</tt> indicates that the |
| 671 | remote end did not report the successful update of the ref |
| 672 | (perhaps because of a temporary error on the remote side, a |
| 673 | break in the network connection, or other transient error). |
| 674 | </p> |
| 675 | </dd> |
| 676 | <dt> |
| 677 | from |
| 678 | </dt> |
| 679 | <dd> |
| 680 | <p> |
| 681 | The name of the local ref being pushed, minus its |
| 682 | <tt>refs/<type>/</tt> prefix. In the case of deletion, the |
| 683 | name of the local ref is omitted. |
| 684 | </p> |
| 685 | </dd> |
| 686 | <dt> |
| 687 | to |
| 688 | </dt> |
| 689 | <dd> |
| 690 | <p> |
| 691 | The name of the remote ref being updated, minus its |
| 692 | <tt>refs/<type>/</tt> prefix. |
| 693 | </p> |
| 694 | </dd> |
| 695 | <dt> |
| 696 | reason |
| 697 | </dt> |
| 698 | <dd> |
| 699 | <p> |
| 700 | A human-readable explanation. In the case of successfully pushed |
| 701 | refs, no explanation is needed. For a failed ref, the reason for |
| 702 | failure is described. |
| 703 | </p> |
| 704 | </dd> |
| 705 | </dl> |
| 706 | </div> |
Junio C Hamano | 6926bef | 2007-06-16 09:54:05 | [diff] [blame] | 707 | <h2>Examples</h2> |
| 708 | <div class="sectionbody"> |
| 709 | <dl> |
| 710 | <dt> |
| 711 | git push origin master |
| 712 | </dt> |
| 713 | <dd> |
| 714 | <p> |
| 715 | Find a ref that matches <tt>master</tt> in the source repository |
| 716 | (most likely, it would find <tt>refs/heads/master</tt>), and update |
| 717 | the same ref (e.g. <tt>refs/heads/master</tt>) in <tt>origin</tt> repository |
Junio C Hamano | a9aee78 | 2008-04-23 16:09:20 | [diff] [blame] | 718 | with it. If <tt>master</tt> did not exist remotely, it would be |
| 719 | created. |
Junio C Hamano | 6926bef | 2007-06-16 09:54:05 | [diff] [blame] | 720 | </p> |
| 721 | </dd> |
| 722 | <dt> |
| 723 | git push origin :experimental |
| 724 | </dt> |
| 725 | <dd> |
| 726 | <p> |
| 727 | Find a ref that matches <tt>experimental</tt> in the <tt>origin</tt> repository |
| 728 | (e.g. <tt>refs/heads/experimental</tt>), and delete it. |
| 729 | </p> |
| 730 | </dd> |
| 731 | <dt> |
| 732 | git push origin master:satellite/master |
| 733 | </dt> |
| 734 | <dd> |
| 735 | <p> |
| 736 | Find a ref that matches <tt>master</tt> in the source repository |
| 737 | (most likely, it would find <tt>refs/heads/master</tt>), and update |
| 738 | the ref that matches <tt>satellite/master</tt> (most likely, it would |
| 739 | be <tt>refs/remotes/satellite/master</tt>) in <tt>origin</tt> repository with it. |
| 740 | </p> |
| 741 | </dd> |
Junio C Hamano | bfd4f9a | 2007-09-06 08:52:44 | [diff] [blame] | 742 | <dt> |
| 743 | git push origin master:refs/heads/experimental |
| 744 | </dt> |
| 745 | <dd> |
| 746 | <p> |
| 747 | Create the branch <tt>experimental</tt> in the <tt>origin</tt> repository |
Junio C Hamano | a9aee78 | 2008-04-23 16:09:20 | [diff] [blame] | 748 | by copying the current <tt>master</tt> branch. This form is only |
| 749 | needed to create a new branch or tag in the remote repository when |
| 750 | the local name and the remote name are different; otherwise, |
| 751 | the ref name on its own will work. |
Junio C Hamano | bfd4f9a | 2007-09-06 08:52:44 | [diff] [blame] | 752 | </p> |
| 753 | </dd> |
Junio C Hamano | 6926bef | 2007-06-16 09:54:05 | [diff] [blame] | 754 | </dl> |
| 755 | </div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 756 | <h2>Author</h2> |
| 757 | <div class="sectionbody"> |
Junio C Hamano | 3f403b0 | 2006-12-13 10:14:13 | [diff] [blame] | 758 | <p>Written by Junio C Hamano <junkio@cox.net>, later rewritten in C |
| 759 | by Linus Torvalds <torvalds@osdl.org></p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 760 | </div> |
| 761 | <h2>Documentation</h2> |
| 762 | <div class="sectionbody"> |
| 763 | <p>Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.</p> |
| 764 | </div> |
| 765 | <h2>GIT</h2> |
| 766 | <div class="sectionbody"> |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 767 | <p>Part of the <a href="git.html">git(1)</a> suite</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 768 | </div> |
| 769 | <div id="footer"> |
| 770 | <div id="footer-text"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame^] | 771 | Last updated 08-Jun-2008 22:46:55 UTC |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 772 | </div> |
| 773 | </div> |
| 774 | </body> |
| 775 | </html> |