blob: f666f3ec7adb239e74757fa3aa4bb5ef44b9d45b [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!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 Hamano40f2f8d2006-02-07 08:04:396<meta name="generator" content="AsciiDoc 7.0.2" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
19a { color: blue; }
20a:visited { color: fuchsia; }
21
22em {
23 font-style: italic;
24}
25
26strong {
27 font-weight: bold;
28}
29
30tt {
31 color: navy;
32}
33
34h1, 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
42h1 {
43 border-bottom: 2px solid silver;
44}
45h2 {
46 border-bottom: 2px solid silver;
47 padding-top: 0.5em;
48}
49
50div.sectionbody {
51 font-family: serif;
52 margin-left: 0;
53}
54
55hr {
56 border: 1px solid silver;
57}
58
59p {
60 margin-top: 0.5em;
61 margin-bottom: 0.5em;
62}
63
64pre {
65 padding: 0;
66 margin: 0;
67}
68
69span#author {
70 color: #527bbd;
71 font-family: sans-serif;
72 font-weight: bold;
73 font-size: 1.2em;
74}
75span#email {
76}
77span#revision {
78 font-family: sans-serif;
79}
80
81div#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}
88div#footer-text {
89 float: left;
90 padding-bottom: 0.5em;
91}
92div#footer-badges {
93 float: right;
94 padding-bottom: 0.5em;
95}
96
97div#preamble,
98div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
99div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
100div.admonitionblock {
101 margin-right: 10%;
102 margin-top: 1.5em;
103 margin-bottom: 1.5em;
104}
105div.admonitionblock {
106 margin-top: 2.5em;
107 margin-bottom: 2.5em;
108}
109
110div.content { /* Block element content. */
111 padding: 0;
112}
113
114/* Block element titles. */
115div.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}
122div.title + * {
123 margin-top: 0;
124}
125
126td div.title:first-child {
127 margin-top: 0.0em;
128}
129div.content div.title:first-child {
130 margin-top: 0.0em;
131}
132div.content + div.title {
133 margin-top: 0.0em;
134}
135
136div.sidebarblock > div.content {
137 background: #ffffee;
138 border: 1px solid silver;
139 padding: 0.5em;
140}
141
142div.listingblock > div.content {
143 border: 1px solid silver;
144 background: #f4f4f4;
145 padding: 0.5em;
146}
147
148div.quoteblock > div.content {
149 padding-left: 2.0em;
150}
151div.quoteblock .attribution {
152 text-align: right;
153}
154
155div.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}
163div.admonitionblock td.content {
164 padding-left: 0.5em;
165 border-left: 2px solid silver;
166}
167
168div.exampleblock > div.content {
169 border-left: 2px solid silver;
170 padding: 0.5em;
171}
172
173div.verseblock div.content {
174 white-space: pre;
175}
176
177div.imageblock div.content { padding-left: 0; }
178div.imageblock img { border: 1px solid silver; }
179span.image img { border-style: none; }
180
181dl {
182 margin-top: 0.8em;
183 margin-bottom: 0.8em;
184}
185dt {
186 margin-top: 0.5em;
187 margin-bottom: 0;
188 font-style: italic;
189}
190dd > *:first-child {
191 margin-top: 0;
192}
193
194ul, ol {
195 list-style-position: outside;
196}
197ol.olist2 {
198 list-style-type: lower-alpha;
199}
200
201div.tableblock > table {
202 border-color: #527bbd;
203 border-width: 3px;
204}
205thead {
206 font-family: sans-serif;
207 font-weight: bold;
208}
209tfoot {
210 font-weight: bold;
211}
212
213div.hlist {
214 margin-top: 0.8em;
215 margin-bottom: 0.8em;
216}
217td.hlist1 {
218 vertical-align: top;
219 font-style: italic;
220 padding-right: 0.8em;
221}
222td.hlist2 {
223 vertical-align: top;
224}
225
226@media print {
227 div#footer-badges { display: none; }
228}
229include::./stylesheets/xhtml11-manpage.css[]
230/* Workarounds for IE6's broken and incomplete CSS2. */
231
232div.sidebar-content {
233 background: #ffffee;
234 border: 1px solid silver;
235 padding: 0.5em;
236}
237div.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
244div.listingblock div.content {
245 border: 1px solid silver;
246 background: #f4f4f4;
247 padding: 0.5em;
248}
249
250div.quoteblock-content {
251 padding-left: 2.0em;
252}
253
254div.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>
264git-push(1) Manual Page
265</h1>
266<h2>NAME</h2>
267<div class="sectionbody">
268<p>git-push -
Junio C Hamano01078922006-03-10 00:31:47269 Update remote refs along with associated objects
Junio C Hamano1a4e8412005-12-27 08:17:23270</p>
271</div>
272</div>
273<h2>SYNOPSIS</h2>
274<div class="sectionbody">
Junio C Hamanoa9b8d242007-05-19 04:51:55275<div class="verseblock">
276<div class="content"><em>git-push</em> [--all] [--tags] [--receive-pack=&lt;git-receive-pack&gt;]
277 [--repo=all] [-f | --force] [-v] [&lt;repository&gt; &lt;refspec&gt;&#8230;]</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23278</div>
279<h2>DESCRIPTION</h2>
280<div class="sectionbody">
281<p>Updates remote refs using local refs, while sending objects
282necessary to complete the given refs.</p>
Junio C Hamano40f2f8d2006-02-07 08:04:39283<p>You can make interesting things happen to a repository
Junio C Hamano1a4e8412005-12-27 08:17:23284every time you push into it, by setting up <em>hooks</em> there. See
285documentation 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&lt;repository&gt;
292</dt>
293<dd>
294<p>
Junio C Hamano40f2f8d2006-02-07 08:04:39295 The "remote" repository that is destination of a push
296 operation. See the section <a href="#URLS">GIT URLS</a> below.
Junio C Hamano1a4e8412005-12-27 08:17:23297</p>
Junio C Hamano40f2f8d2006-02-07 08:04:39298</dd>
299<dt>
300&lt;refspec&gt;
301</dt>
302<dd>
303<p>
304 The canonical format of a &lt;refspec&gt; parameter is
305 <tt>+?&lt;src&gt;:&lt;dst&gt;</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 &lt;src&gt; side can be an
310arbitrary "SHA1 expression" that can be used as an
311argument to <tt>git-cat-file -t</tt>. E.g. <tt>master~4</tt> (push
312four parents before the current master head).</p>
313<p>The local ref that matches &lt;src&gt; is used
314to fast forward the remote ref that matches &lt;dst&gt;. If
315the optional plus <tt>+</tt> is used, the remote ref is updated
316even if it does not result in a fast forward update.</p>
Junio C Hamano7e9f6b72006-02-22 10:44:55317<p>Note: If no explicit refspec is found, (that is neither
318on the command line nor in any Push line of the
319corresponding remotes file---see below), then all the
320refs that exist both on the local side and on the remote
321side are updated.</p>
Junio C Hamano3f403b02006-12-13 10:14:13322<p><tt>tag &lt;tag&gt;</tt> means the same as <tt>refs/tags/&lt;tag&gt;:refs/tags/&lt;tag&gt;</tt>.</p>
Junio C Hamano6926bef2007-06-16 09:54:05323<p>A parameter &lt;ref&gt; without a colon pushes the &lt;ref&gt; from the source
324repository to the destination repository under the same name.</p>
Junio C Hamano3f403b02006-12-13 10:14:13325<p>Pushing an empty &lt;src&gt; allows you to delete the &lt;dst&gt; ref from
326the remote repository.</p>
Junio C Hamano40f2f8d2006-02-07 08:04:39327</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 Hamano4ad294b2007-01-20 02:22:50348--receive-pack=&lt;git-receive-pack&gt;
Junio C Hamano1ce39ab2007-01-16 22:05:10349</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 Hamano4ad294b2007-01-20 02:22:50359--exec=&lt;git-receive-pack&gt;
360</dt>
361<dd>
362<p>
363 Same as --receive-pack=&lt;git-receive-pack&gt;.
364</p>
365</dd>
366<dt>
Junio C Hamano40f2f8d2006-02-07 08:04:39367-f, --force
368</dt>
369<dd>
370<p>
371 Usually, the command refuses to update a remote ref that is
Junio C Hamano51c2ab02006-07-09 20:38:54372 not a descendant of the local ref used to overwrite it.
Junio C Hamano40f2f8d2006-02-07 08:04:39373 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 Hamano1ce39ab2007-01-16 22:05:10377<dt>
378--repo=&lt;repo&gt;
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 Hamano40f2f8d2006-02-07 08:04:39404</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
409to name the remote repository:</p>
Junio C Hamano1a4e8412005-12-27 08:17:23410<div class="exampleblock">
411<div class="exampleblock-content">
412<ul>
413<li>
414<p>
415rsync://host.xz/path/to/repo.git/
416</p>
417</li>
418<li>
419<p>
420http://host.xz/path/to/repo.git/
421</p>
422</li>
423<li>
424<p>
425https://host.xz/path/to/repo.git/
426</p>
427</li>
428<li>
429<p>
430git://host.xz/path/to/repo.git/
431</p>
432</li>
433<li>
434<p>
435git://host.xz/~user/path/to/repo.git/
436</p>
437</li>
438<li>
439<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40440ssh://&#91;user@&#93;host.xz/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:23441</p>
442</li>
443<li>
444<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40445ssh://&#91;user@&#93;host.xz/~user/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:23446</p>
447</li>
448<li>
449<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40450ssh://&#91;user@&#93;host.xz/~/path/to/repo.git
Junio C Hamano1a4e8412005-12-27 08:17:23451</p>
452</li>
453</ul>
454</div></div>
Junio C Hamano7ccb9fd2006-07-15 01:38:40455<p>SSH is the default transport protocol. You can optionally specify
456which user to log-in as, and an alternate, scp-like syntax is also
457supported. Both syntaxes support username expansion,
Junio C Hamano1a4e8412005-12-27 08:17:23458as does the native git protocol. The following three are
459identical to the last three above, respectively:</p>
460<div class="exampleblock">
461<div class="exampleblock-content">
462<ul>
463<li>
464<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40465&#91;user@&#93;host.xz:/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:23466</p>
467</li>
468<li>
469<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40470&#91;user@&#93;host.xz:~user/path/to/repo.git/
Junio C Hamano1a4e8412005-12-27 08:17:23471</p>
472</li>
473<li>
474<p>
Junio C Hamano7ccb9fd2006-07-15 01:38:40475&#91;user@&#93;host.xz:path/to/repo.git
Junio C Hamano1a4e8412005-12-27 08:17:23476</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 Hamano40f2f8d2006-02-07 08:04:39491</div>
492<h2>REMOTES</h2>
493<div class="sectionbody">
Junio C Hamano1a4e8412005-12-27 08:17:23494<p>In addition to the above, as a short-hand, the name of a
495file in <tt>$GIT_DIR/remotes</tt> directory can be given; the
496named file should be in the following format:</p>
Junio C Hamano1caaf472006-12-31 08:29:35497<div class="listingblock">
Junio C Hamano1a4e8412005-12-27 08:17:23498<div class="content">
Junio C Hamanod3361ad2007-01-01 03:20:24499<pre><tt> URL: one of the above URL format
500 Push: &lt;refspec&gt;
501 Pull: &lt;refspec&gt;
502</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23503</div></div>
Junio C Hamano40f2f8d2006-02-07 08:04:39504<p>Then such a short-hand is specified in place of
Junio C Hamano1a4e8412005-12-27 08:17:23505&lt;repository&gt; without &lt;refspec&gt; parameters on the command
506line, &lt;refspec&gt; specified on <tt>Push:</tt> lines or <tt>Pull:</tt>
507lines are used for <tt>git-push</tt> and <tt>git-fetch</tt>/<tt>git-pull</tt>,
Junio C Hamano51c2ab02006-07-09 20:38:54508respectively. Multiple <tt>Push:</tt> and <tt>Pull:</tt> lines may
Junio C Hamano1a4e8412005-12-27 08:17:23509be specified for additional branch mappings.</p>
Junio C Hamano249572f2006-10-24 05:44:08510<p>Or, equivalently, in the <tt>$GIT_DIR/config</tt> (note the use
511of <tt>fetch</tt> instead of <tt>Pull:</tt>):</p>
Junio C Hamano1caaf472006-12-31 08:29:35512<div class="listingblock">
Junio C Hamano249572f2006-10-24 05:44:08513<div class="content">
Junio C Hamanod3361ad2007-01-01 03:20:24514<pre><tt> [remote "&lt;remote&gt;"]
515 url = &lt;url&gt;
516 push = &lt;refspec&gt;
517 fetch = &lt;refspec&gt;
518</tt></pre>
Junio C Hamano249572f2006-10-24 05:44:08519</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23520<p>The name of a file in <tt>$GIT_DIR/branches</tt> directory can be
521specified as an older notation short-hand; the named
522file should contain a single line, a URL in one of the
523above formats, optionally followed by a hash <tt>#</tt> and the
524name of remote head (URL fragment notation).
525<tt>$GIT_DIR/branches/&lt;remote&gt;</tt> file that stores a &lt;url&gt;
526without the fragment is equivalent to have this in the
527corresponding file in the <tt>$GIT_DIR/remotes/</tt> directory.</p>
Junio C Hamano1caaf472006-12-31 08:29:35528<div class="listingblock">
Junio C Hamano1a4e8412005-12-27 08:17:23529<div class="content">
Junio C Hamanod3361ad2007-01-01 03:20:24530<pre><tt> URL: &lt;url&gt;
531 Pull: refs/heads/master:&lt;remote&gt;
532</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23533</div></div>
534<p>while having <tt>&lt;url&gt;#&lt;head&gt;</tt> is equivalent to</p>
Junio C Hamano1caaf472006-12-31 08:29:35535<div class="listingblock">
Junio C Hamano1a4e8412005-12-27 08:17:23536<div class="content">
Junio C Hamanod3361ad2007-01-01 03:20:24537<pre><tt> URL: &lt;url&gt;
538 Pull: refs/heads/&lt;head&gt;:&lt;remote&gt;</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23539</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23540</div>
Junio C Hamano6926bef2007-06-16 09:54:05541<h2>Examples</h2>
542<div class="sectionbody">
543<dl>
544<dt>
545git 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>
556git 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>
565git 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 Hamano1a4e8412005-12-27 08:17:23577<h2>Author</h2>
578<div class="sectionbody">
Junio C Hamano3f403b02006-12-13 10:14:13579<p>Written by Junio C Hamano &lt;junkio@cox.net&gt;, later rewritten in C
580by Linus Torvalds &lt;torvalds@osdl.org&gt;</p>
Junio C Hamano1a4e8412005-12-27 08:17:23581</div>
582<h2>Documentation</h2>
583<div class="sectionbody">
584<p>Documentation by Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</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 Hamanobb6e0782007-07-19 02:14:50592Last updated 19-Jul-2007 02:09:49 UTC
Junio C Hamano1a4e8412005-12-27 08:17:23593</div>
594</div>
595</body>
596</html>