Autogenerated HTML docs for v2.38.1-119-g9c32c
[git-htmldocs.git] / git-push.html
blobd32cbbf5e6c360792909e41706e8ff9ff34bbaf3
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
7 <meta name="generator" content="AsciiDoc 10.2.0" />
8 <title>git-push(1)</title>
9 <style type="text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
12 /* Default font. */
13 body {
14 font-family: Georgia,serif;
17 /* Title font. */
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
21 #toctitle,
22 #author, #revnumber, #revdate, #revremark,
23 #footer {
24 font-family: Arial,Helvetica,sans-serif;
27 body {
28 margin: 1em 5% 1em 5%;
31 a {
32 color: blue;
33 text-decoration: underline;
35 a:visited {
36 color: fuchsia;
39 em {
40 font-style: italic;
41 color: navy;
44 strong {
45 font-weight: bold;
46 color: #083194;
49 h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
51 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
56 h1, h2, h3 {
57 border-bottom: 2px solid silver;
59 h2 {
60 padding-top: 0.5em;
62 h3 {
63 float: left;
65 h3 + * {
66 clear: left;
68 h5 {
69 font-size: 1.0em;
72 div.sectionbody {
73 margin-left: 0;
76 hr {
77 border: 1px solid silver;
80 p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
85 ul, ol, li > p {
86 margin-top: 0;
88 ul > li { color: #aaa; }
89 ul > li > * { color: black; }
91 .monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
95 padding: 0;
96 margin: 0;
98 pre {
99 white-space: pre-wrap;
102 #author {
103 color: #527bbd;
104 font-weight: bold;
105 font-size: 1.1em;
107 #email {
109 #revnumber, #revdate, #revremark {
112 #footer {
113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
118 #footer-text {
119 float: left;
120 padding-bottom: 0.5em;
122 #footer-badges {
123 float: right;
124 padding-bottom: 0.5em;
127 #preamble {
128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
131 div.imageblock, div.exampleblock, div.verseblock,
132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133 div.admonitionblock {
134 margin-top: 1.0em;
135 margin-bottom: 1.5em;
137 div.admonitionblock {
138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
144 div.content { /* Block element content. */
145 padding: 0;
148 /* Block element titles. */
149 div.title, caption.title {
150 color: #527bbd;
151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
156 div.title + * {
157 margin-top: 0;
160 td div.title:first-child {
161 margin-top: 0.0em;
163 div.content div.title:first-child {
164 margin-top: 0.0em;
166 div.content + div.title {
167 margin-top: 0.0em;
170 div.sidebarblock > div.content {
171 background: #ffffee;
172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
174 padding: 0.5em;
177 div.listingblock > div.content {
178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
181 padding: 0.5em;
184 div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
187 margin-right: 10%;
188 border-left: 5px solid #f0f0f0;
189 color: #888;
192 div.quoteblock > div.attribution {
193 padding-top: 0.5em;
194 text-align: right;
197 div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
201 div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
205 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
207 text-align: left;
210 div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
218 div.admonitionblock td.content {
219 padding-left: 0.5em;
220 border-left: 3px solid #dddddd;
223 div.exampleblock > div.content {
224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
228 div.imageblock div.content { padding-left: 0; }
229 span.image img { border-style: none; vertical-align: text-bottom; }
230 a.image:visited { color: white; }
232 dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
236 dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
239 font-style: normal;
240 color: navy;
242 dd > *:first-child {
243 margin-top: 0.1em;
246 ul, ol {
247 list-style-position: outside;
249 ol.arabic {
250 list-style-type: decimal;
252 ol.loweralpha {
253 list-style-type: lower-alpha;
255 ol.upperalpha {
256 list-style-type: upper-alpha;
258 ol.lowerroman {
259 list-style-type: lower-roman;
261 ol.upperroman {
262 list-style-type: upper-roman;
265 div.compact ul, div.compact ol,
266 div.compact p, div.compact p,
267 div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
272 tfoot {
273 font-weight: bold;
275 td > div.verse {
276 white-space: pre;
279 div.hdlist {
280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
283 div.hdlist tr {
284 padding-bottom: 15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
289 td.hdlist1 {
290 vertical-align: top;
291 font-style: normal;
292 padding-right: 0.8em;
293 color: navy;
295 td.hdlist2 {
296 vertical-align: top;
298 div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
303 .comment {
304 background: yellow;
307 .footnote, .footnoteref {
308 font-size: 0.8em;
311 span.footnote, span.footnoteref {
312 vertical-align: super;
315 #footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
320 #footnotes div.footnote {
321 margin: 0 0 5px 0;
324 #footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
334 div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
339 div.colist td img {
340 margin-top: 0.3em;
343 @media print {
344 #footer-badges { display: none; }
347 #toc {
348 margin-bottom: 2.5em;
351 #toctitle {
352 color: #527bbd;
353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
360 margin-top: 0;
361 margin-bottom: 0;
363 div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
367 div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
371 div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
376 span.aqua { color: aqua; }
377 span.black { color: black; }
378 span.blue { color: blue; }
379 span.fuchsia { color: fuchsia; }
380 span.gray { color: gray; }
381 span.green { color: green; }
382 span.lime { color: lime; }
383 span.maroon { color: maroon; }
384 span.navy { color: navy; }
385 span.olive { color: olive; }
386 span.purple { color: purple; }
387 span.red { color: red; }
388 span.silver { color: silver; }
389 span.teal { color: teal; }
390 span.white { color: white; }
391 span.yellow { color: yellow; }
393 span.aqua-background { background: aqua; }
394 span.black-background { background: black; }
395 span.blue-background { background: blue; }
396 span.fuchsia-background { background: fuchsia; }
397 span.gray-background { background: gray; }
398 span.green-background { background: green; }
399 span.lime-background { background: lime; }
400 span.maroon-background { background: maroon; }
401 span.navy-background { background: navy; }
402 span.olive-background { background: olive; }
403 span.purple-background { background: purple; }
404 span.red-background { background: red; }
405 span.silver-background { background: silver; }
406 span.teal-background { background: teal; }
407 span.white-background { background: white; }
408 span.yellow-background { background: yellow; }
410 span.big { font-size: 2em; }
411 span.small { font-size: 0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
421 * xhtml11 specific
423 * */
425 div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
429 div.tableblock > table {
430 border: 3px solid #527bbd;
432 thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
436 p.table {
437 margin-top: 0;
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock > table[frame="void"] {
441 border-style: none;
443 div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
454 * html5 specific
456 * */
458 table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
462 thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
466 p.tableblock {
467 margin-top: 0;
469 table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
498 th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
501 th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
505 th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
517 * manpage specific
519 * */
521 body.manpage h1 {
522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
527 body.manpage h2 {
528 border-style: none;
530 body.manpage div.sectionbody {
531 margin-left: 3em;
534 @media print {
535 body.manpage div#toc { display: none; }
539 </style>
540 <script type="text/javascript">
541 /*<![CDATA[*/
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
552 * Version: 0.4
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
561 // toclevels = 1..4.
562 toc: function (toclevels) {
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
572 return text;
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
594 iterate(i);
598 iterate(el);
599 return result;
602 var toc = document.getElementById("toc");
603 if (!toc) {
604 return;
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
648 footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
651 var noteholder = document.getElementById("footnotes");
652 if (!noteholder) {
653 return;
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
659 entriesToRemove.push(entry);
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
708 install: function(toclevels) {
709 var timerId;
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
731 asciidoc.install();
732 /*]]>*/
733 </script>
734 </head>
735 <body class="manpage">
736 <div id="header">
737 <h1>
738 git-push(1) Manual Page
739 </h1>
740 <h2>NAME</h2>
741 <div class="sectionbody">
742 <p>git-push -
743 Update remote refs along with associated objects
744 </p>
745 </div>
746 </div>
747 <div id="content">
748 <div class="sect1">
749 <h2 id="_synopsis">SYNOPSIS</h2>
750 <div class="sectionbody">
751 <div class="verseblock">
752 <pre class="content"><em>git push</em> [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=&lt;git-receive-pack&gt;]
753 [--repo=&lt;repository&gt;] [-f | --force] [-d | --delete] [--prune] [-v | --verbose]
754 [-u | --set-upstream] [-o &lt;string&gt; | --push-option=&lt;string&gt;]
755 [--[no-]signed|--signed=(true|false|if-asked)]
756 [--force-with-lease[=&lt;refname&gt;[:&lt;expect&gt;]] [--force-if-includes]]
757 [--no-verify] [&lt;repository&gt; [&lt;refspec&gt;&#8230;]]</pre>
758 <div class="attribution">
759 </div></div>
760 </div>
761 </div>
762 <div class="sect1">
763 <h2 id="_description">DESCRIPTION</h2>
764 <div class="sectionbody">
765 <div class="paragraph"><p>Updates remote refs using local refs, while sending objects
766 necessary to complete the given refs.</p></div>
767 <div class="paragraph"><p>You can make interesting things happen to a repository
768 every time you push into it, by setting up <em>hooks</em> there. See
769 documentation for <a href="git-receive-pack.html">git-receive-pack(1)</a>.</p></div>
770 <div class="paragraph"><p>When the command line does not specify where to push with the
771 <code>&lt;repository&gt;</code> argument, <code>branch.*.remote</code> configuration for the
772 current branch is consulted to determine where to push. If the
773 configuration is missing, it defaults to <em>origin</em>.</p></div>
774 <div class="paragraph"><p>When the command line does not specify what to push with <code>&lt;refspec&gt;...</code>
775 arguments or <code>--all</code>, <code>--mirror</code>, <code>--tags</code> options, the command finds
776 the default <code>&lt;refspec&gt;</code> by consulting <code>remote.*.push</code> configuration,
777 and if it is not found, honors <code>push.default</code> configuration to decide
778 what to push (See <a href="git-config.html">git-config(1)</a> for the meaning of <code>push.default</code>).</p></div>
779 <div class="paragraph"><p>When neither the command-line nor the configuration specify what to
780 push, the default behavior is used, which corresponds to the <code>simple</code>
781 value for <code>push.default</code>: the current branch is pushed to the
782 corresponding upstream branch, but as a safety measure, the push is
783 aborted if the upstream branch does not have the same name as the
784 local one.</p></div>
785 </div>
786 </div>
787 <div class="sect1">
788 <h2 id="_options_a_id_options_a">OPTIONS<a id="OPTIONS"></a></h2>
789 <div class="sectionbody">
790 <div class="dlist"><dl>
791 <dt class="hdlist1">
792 &lt;repository&gt;
793 </dt>
794 <dd>
796 The "remote" repository that is destination of a push
797 operation. This parameter can be either a URL
798 (see the section <a href="#URLS">GIT URLS</a> below) or the name
799 of a remote (see the section <a href="#REMOTES">REMOTES</a> below).
800 </p>
801 </dd>
802 <dt class="hdlist1">
803 &lt;refspec&gt;&#8230;
804 </dt>
805 <dd>
807 Specify what destination ref to update with what source object.
808 The format of a &lt;refspec&gt; parameter is an optional plus
809 <code>+</code>, followed by the source object &lt;src&gt;, followed
810 by a colon <code>:</code>, followed by the destination ref &lt;dst&gt;.
811 </p>
812 <div class="paragraph"><p>The &lt;src&gt; is often the name of the branch you would want to push, but
813 it can be any arbitrary "SHA-1 expression", such as <code>master~4</code> or
814 <code>HEAD</code> (see <a href="gitrevisions.html">gitrevisions(7)</a>).</p></div>
815 <div class="paragraph"><p>The &lt;dst&gt; tells which ref on the remote side is updated with this
816 push. Arbitrary expressions cannot be used here, an actual ref must
817 be named.
818 If <code>git push [&lt;repository&gt;]</code> without any <code>&lt;refspec&gt;</code> argument is set to
819 update some ref at the destination with <code>&lt;src&gt;</code> with
820 <code>remote.&lt;repository&gt;.push</code> configuration variable, <code>:&lt;dst&gt;</code> part can
821 be omitted&#8212;such a push will update a ref that <code>&lt;src&gt;</code> normally updates
822 without any <code>&lt;refspec&gt;</code> on the command line. Otherwise, missing
823 <code>:&lt;dst&gt;</code> means to update the same ref as the <code>&lt;src&gt;</code>.</p></div>
824 <div class="paragraph"><p>If &lt;dst&gt; doesn&#8217;t start with <code>refs/</code> (e.g. <code>refs/heads/master</code>) we will
825 try to infer where in <code>refs/*</code> on the destination &lt;repository&gt; it
826 belongs based on the type of &lt;src&gt; being pushed and whether &lt;dst&gt;
827 is ambiguous.</p></div>
828 <div class="openblock">
829 <div class="content">
830 <div class="ulist"><ul>
831 <li>
833 If &lt;dst&gt; unambiguously refers to a ref on the &lt;repository&gt; remote,
834 then push to that ref.
835 </p>
836 </li>
837 <li>
839 If &lt;src&gt; resolves to a ref starting with refs/heads/ or refs/tags/,
840 then prepend that to &lt;dst&gt;.
841 </p>
842 </li>
843 <li>
845 Other ambiguity resolutions might be added in the future, but for
846 now any other cases will error out with an error indicating what we
847 tried, and depending on the <code>advice.pushUnqualifiedRefname</code>
848 configuration (see <a href="git-config.html">git-config(1)</a>) suggest what refs/
849 namespace you may have wanted to push to.
850 </p>
851 </li>
852 </ul></div>
853 </div></div>
854 <div class="paragraph"><p>The object referenced by &lt;src&gt; is used to update the &lt;dst&gt; reference
855 on the remote side. Whether this is allowed depends on where in
856 <code>refs/*</code> the &lt;dst&gt; reference lives as described in detail below, in
857 those sections "update" means any modifications except deletes, which
858 as noted after the next few sections are treated differently.</p></div>
859 <div class="paragraph"><p>The <code>refs/heads/*</code> namespace will only accept commit objects, and
860 updates only if they can be fast-forwarded.</p></div>
861 <div class="paragraph"><p>The <code>refs/tags/*</code> namespace will accept any kind of object (as
862 commits, trees and blobs can be tagged), and any updates to them will
863 be rejected.</p></div>
864 <div class="paragraph"><p>It&#8217;s possible to push any type of object to any namespace outside of
865 <code>refs/{tags,heads}/*</code>. In the case of tags and commits, these will be
866 treated as if they were the commits inside <code>refs/heads/*</code> for the
867 purposes of whether the update is allowed.</p></div>
868 <div class="paragraph"><p>I.e. a fast-forward of commits and tags outside <code>refs/{tags,heads}/*</code>
869 is allowed, even in cases where what&#8217;s being fast-forwarded is not a
870 commit, but a tag object which happens to point to a new commit which
871 is a fast-forward of the commit the last tag (or commit) it&#8217;s
872 replacing. Replacing a tag with an entirely different tag is also
873 allowed, if it points to the same commit, as well as pushing a peeled
874 tag, i.e. pushing the commit that existing tag object points to, or a
875 new tag object which an existing commit points to.</p></div>
876 <div class="paragraph"><p>Tree and blob objects outside of <code>refs/{tags,heads}/*</code> will be treated
877 the same way as if they were inside <code>refs/tags/*</code>, any update of them
878 will be rejected.</p></div>
879 <div class="paragraph"><p>All of the rules described above about what&#8217;s not allowed as an update
880 can be overridden by adding an the optional leading <code>+</code> to a refspec
881 (or using <code>--force</code> command line option). The only exception to this
882 is that no amount of forcing will make the <code>refs/heads/*</code> namespace
883 accept a non-commit object. Hooks and configuration can also override
884 or amend these rules, see e.g. <code>receive.denyNonFastForwards</code> in
885 <a href="git-config.html">git-config(1)</a> and <code>pre-receive</code> and <code>update</code> in
886 <a href="githooks.html">githooks(5)</a>.</p></div>
887 <div class="paragraph"><p>Pushing an empty &lt;src&gt; allows you to delete the &lt;dst&gt; ref from the
888 remote repository. Deletions are always accepted without a leading <code>+</code>
889 in the refspec (or <code>--force</code>), except when forbidden by configuration
890 or hooks. See <code>receive.denyDeletes</code> in <a href="git-config.html">git-config(1)</a> and
891 <code>pre-receive</code> and <code>update</code> in <a href="githooks.html">githooks(5)</a>.</p></div>
892 <div class="paragraph"><p>The special refspec <code>:</code> (or <code>+:</code> to allow non-fast-forward updates)
893 directs Git to push "matching" branches: for every branch that exists on
894 the local side, the remote side is updated if a branch of the same name
895 already exists on the remote side.</p></div>
896 <div class="paragraph"><p><code>tag &lt;tag&gt;</code> means the same as <code>refs/tags/&lt;tag&gt;:refs/tags/&lt;tag&gt;</code>.</p></div>
897 </dd>
898 <dt class="hdlist1">
899 --all
900 </dt>
901 <dd>
903 Push all branches (i.e. refs under <code>refs/heads/</code>); cannot be
904 used with other &lt;refspec&gt;.
905 </p>
906 </dd>
907 <dt class="hdlist1">
908 --prune
909 </dt>
910 <dd>
912 Remove remote branches that don&#8217;t have a local counterpart. For example
913 a remote branch <code>tmp</code> will be removed if a local branch with the same
914 name doesn&#8217;t exist any more. This also respects refspecs, e.g.
915 <code>git push --prune remote refs/heads/*:refs/tmp/*</code> would
916 make sure that remote <code>refs/tmp/foo</code> will be removed if <code>refs/heads/foo</code>
917 doesn&#8217;t exist.
918 </p>
919 </dd>
920 <dt class="hdlist1">
921 --mirror
922 </dt>
923 <dd>
925 Instead of naming each ref to push, specifies that all
926 refs under <code>refs/</code> (which includes but is not
927 limited to <code>refs/heads/</code>, <code>refs/remotes/</code>, and <code>refs/tags/</code>)
928 be mirrored to the remote repository. Newly created local
929 refs will be pushed to the remote end, locally updated refs
930 will be force updated on the remote end, and deleted refs
931 will be removed from the remote end. This is the default
932 if the configuration option <code>remote.&lt;remote&gt;.mirror</code> is
933 set.
934 </p>
935 </dd>
936 <dt class="hdlist1">
938 </dt>
939 <dt class="hdlist1">
940 --dry-run
941 </dt>
942 <dd>
944 Do everything except actually send the updates.
945 </p>
946 </dd>
947 <dt class="hdlist1">
948 --porcelain
949 </dt>
950 <dd>
952 Produce machine-readable output. The output status line for each ref
953 will be tab-separated and sent to stdout instead of stderr. The full
954 symbolic names of the refs will be given.
955 </p>
956 </dd>
957 <dt class="hdlist1">
959 </dt>
960 <dt class="hdlist1">
961 --delete
962 </dt>
963 <dd>
965 All listed refs are deleted from the remote repository. This is
966 the same as prefixing all refs with a colon.
967 </p>
968 </dd>
969 <dt class="hdlist1">
970 --tags
971 </dt>
972 <dd>
974 All refs under <code>refs/tags</code> are pushed, in
975 addition to refspecs explicitly listed on the command
976 line.
977 </p>
978 </dd>
979 <dt class="hdlist1">
980 --follow-tags
981 </dt>
982 <dd>
984 Push all the refs that would be pushed without this option,
985 and also push annotated tags in <code>refs/tags</code> that are missing
986 from the remote but are pointing at commit-ish that are
987 reachable from the refs being pushed. This can also be specified
988 with configuration variable <code>push.followTags</code>. For more
989 information, see <code>push.followTags</code> in <a href="git-config.html">git-config(1)</a>.
990 </p>
991 </dd>
992 <dt class="hdlist1">
993 --[no-]signed
994 </dt>
995 <dt class="hdlist1">
996 --signed=(true|false|if-asked)
997 </dt>
998 <dd>
1000 GPG-sign the push request to update refs on the receiving
1001 side, to allow it to be checked by the hooks and/or be
1002 logged. If <code>false</code> or <code>--no-signed</code>, no signing will be
1003 attempted. If <code>true</code> or <code>--signed</code>, the push will fail if the
1004 server does not support signed pushes. If set to <code>if-asked</code>,
1005 sign if and only if the server supports signed pushes. The push
1006 will also fail if the actual call to <code>gpg --sign</code> fails. See
1007 <a href="git-receive-pack.html">git-receive-pack(1)</a> for the details on the receiving end.
1008 </p>
1009 </dd>
1010 <dt class="hdlist1">
1011 --[no-]atomic
1012 </dt>
1013 <dd>
1015 Use an atomic transaction on the remote side if available.
1016 Either all refs are updated, or on error, no refs are updated.
1017 If the server does not support atomic pushes the push will fail.
1018 </p>
1019 </dd>
1020 <dt class="hdlist1">
1021 -o &lt;option&gt;
1022 </dt>
1023 <dt class="hdlist1">
1024 --push-option=&lt;option&gt;
1025 </dt>
1026 <dd>
1028 Transmit the given string to the server, which passes them to
1029 the pre-receive as well as the post-receive hook. The given string
1030 must not contain a NUL or LF character.
1031 When multiple <code>--push-option=&lt;option&gt;</code> are given, they are
1032 all sent to the other side in the order listed on the
1033 command line.
1034 When no <code>--push-option=&lt;option&gt;</code> is given from the command
1035 line, the values of configuration variable <code>push.pushOption</code>
1036 are used instead.
1037 </p>
1038 </dd>
1039 <dt class="hdlist1">
1040 --receive-pack=&lt;git-receive-pack&gt;
1041 </dt>
1042 <dt class="hdlist1">
1043 --exec=&lt;git-receive-pack&gt;
1044 </dt>
1045 <dd>
1047 Path to the <em>git-receive-pack</em> program on the remote
1048 end. Sometimes useful when pushing to a remote
1049 repository over ssh, and you do not have the program in
1050 a directory on the default $PATH.
1051 </p>
1052 </dd>
1053 <dt class="hdlist1">
1054 --[no-]force-with-lease
1055 </dt>
1056 <dt class="hdlist1">
1057 --force-with-lease=&lt;refname&gt;
1058 </dt>
1059 <dt class="hdlist1">
1060 --force-with-lease=&lt;refname&gt;:&lt;expect&gt;
1061 </dt>
1062 <dd>
1064 Usually, "git push" refuses to update a remote ref that is
1065 not an ancestor of the local ref used to overwrite it.
1066 </p>
1067 <div class="paragraph"><p>This option overrides this restriction if the current value of the
1068 remote ref is the expected value. "git push" fails otherwise.</p></div>
1069 <div class="paragraph"><p>Imagine that you have to rebase what you have already published.
1070 You will have to bypass the "must fast-forward" rule in order to
1071 replace the history you originally published with the rebased history.
1072 If somebody else built on top of your original history while you are
1073 rebasing, the tip of the branch at the remote may advance with their
1074 commit, and blindly pushing with <code>--force</code> will lose their work.</p></div>
1075 <div class="paragraph"><p>This option allows you to say that you expect the history you are
1076 updating is what you rebased and want to replace. If the remote ref
1077 still points at the commit you specified, you can be sure that no
1078 other people did anything to the ref. It is like taking a "lease" on
1079 the ref without explicitly locking it, and the remote ref is updated
1080 only if the "lease" is still valid.</p></div>
1081 <div class="paragraph"><p><code>--force-with-lease</code> alone, without specifying the details, will protect
1082 all remote refs that are going to be updated by requiring their
1083 current value to be the same as the remote-tracking branch we have
1084 for them.</p></div>
1085 <div class="paragraph"><p><code>--force-with-lease=&lt;refname&gt;</code>, without specifying the expected value, will
1086 protect the named ref (alone), if it is going to be updated, by
1087 requiring its current value to be the same as the remote-tracking
1088 branch we have for it.</p></div>
1089 <div class="paragraph"><p><code>--force-with-lease=&lt;refname&gt;:&lt;expect&gt;</code> will protect the named ref (alone),
1090 if it is going to be updated, by requiring its current value to be
1091 the same as the specified value <code>&lt;expect&gt;</code> (which is allowed to be
1092 different from the remote-tracking branch we have for the refname,
1093 or we do not even have to have such a remote-tracking branch when
1094 this form is used). If <code>&lt;expect&gt;</code> is the empty string, then the named ref
1095 must not already exist.</p></div>
1096 <div class="paragraph"><p>Note that all forms other than <code>--force-with-lease=&lt;refname&gt;:&lt;expect&gt;</code>
1097 that specifies the expected current value of the ref explicitly are
1098 still experimental and their semantics may change as we gain experience
1099 with this feature.</p></div>
1100 <div class="paragraph"><p>"--no-force-with-lease" will cancel all the previous --force-with-lease on the
1101 command line.</p></div>
1102 <div class="paragraph"><p>A general note on safety: supplying this option without an expected
1103 value, i.e. as <code>--force-with-lease</code> or <code>--force-with-lease=&lt;refname&gt;</code>
1104 interacts very badly with anything that implicitly runs <code>git fetch</code> on
1105 the remote to be pushed to in the background, e.g. <code>git fetch origin</code>
1106 on your repository in a cronjob.</p></div>
1107 <div class="paragraph"><p>The protection it offers over <code>--force</code> is ensuring that subsequent
1108 changes your work wasn&#8217;t based on aren&#8217;t clobbered, but this is
1109 trivially defeated if some background process is updating refs in the
1110 background. We don&#8217;t have anything except the remote tracking info to
1111 go by as a heuristic for refs you&#8217;re expected to have seen &amp; are
1112 willing to clobber.</p></div>
1113 <div class="paragraph"><p>If your editor or some other system is running <code>git fetch</code> in the
1114 background for you a way to mitigate this is to simply set up another
1115 remote:</p></div>
1116 <div class="literalblock">
1117 <div class="content">
1118 <pre><code>git remote add origin-push $(git config remote.origin.url)
1119 git fetch origin-push</code></pre>
1120 </div></div>
1121 <div class="paragraph"><p>Now when the background process runs <code>git fetch origin</code> the references
1122 on <code>origin-push</code> won&#8217;t be updated, and thus commands like:</p></div>
1123 <div class="literalblock">
1124 <div class="content">
1125 <pre><code>git push --force-with-lease origin-push</code></pre>
1126 </div></div>
1127 <div class="paragraph"><p>Will fail unless you manually run <code>git fetch origin-push</code>. This method
1128 is of course entirely defeated by something that runs <code>git fetch
1129 --all</code>, in that case you&#8217;d need to either disable it or do something
1130 more tedious like:</p></div>
1131 <div class="literalblock">
1132 <div class="content">
1133 <pre><code>git fetch # update 'master' from remote
1134 git tag base master # mark our base point
1135 git rebase -i master # rewrite some commits
1136 git push --force-with-lease=master:base master:master</code></pre>
1137 </div></div>
1138 <div class="paragraph"><p>I.e. create a <code>base</code> tag for versions of the upstream code that you&#8217;ve
1139 seen and are willing to overwrite, then rewrite history, and finally
1140 force push changes to <code>master</code> if the remote version is still at
1141 <code>base</code>, regardless of what your local <code>remotes/origin/master</code> has been
1142 updated to in the background.</p></div>
1143 <div class="paragraph"><p>Alternatively, specifying <code>--force-if-includes</code> as an ancillary option
1144 along with <code>--force-with-lease[=&lt;refname&gt;]</code> (i.e., without saying what
1145 exact commit the ref on the remote side must be pointing at, or which
1146 refs on the remote side are being protected) at the time of "push" will
1147 verify if updates from the remote-tracking refs that may have been
1148 implicitly updated in the background are integrated locally before
1149 allowing a forced update.</p></div>
1150 </dd>
1151 <dt class="hdlist1">
1153 </dt>
1154 <dt class="hdlist1">
1155 --force
1156 </dt>
1157 <dd>
1159 Usually, the command refuses to update a remote ref that is
1160 not an ancestor of the local ref used to overwrite it.
1161 Also, when <code>--force-with-lease</code> option is used, the command refuses
1162 to update a remote ref whose current value does not match
1163 what is expected.
1164 </p>
1165 <div class="paragraph"><p>This flag disables these checks, and can cause the remote repository
1166 to lose commits; use it with care.</p></div>
1167 <div class="paragraph"><p>Note that <code>--force</code> applies to all the refs that are pushed, hence
1168 using it with <code>push.default</code> set to <code>matching</code> or with multiple push
1169 destinations configured with <code>remote.*.push</code> may overwrite refs
1170 other than the current branch (including local refs that are
1171 strictly behind their remote counterpart). To force a push to only
1172 one branch, use a <code>+</code> in front of the refspec to push (e.g <code>git push
1173 origin +master</code> to force a push to the <code>master</code> branch). See the
1174 <code>&lt;refspec&gt;...</code> section above for details.</p></div>
1175 </dd>
1176 <dt class="hdlist1">
1177 --[no-]force-if-includes
1178 </dt>
1179 <dd>
1181 Force an update only if the tip of the remote-tracking ref
1182 has been integrated locally.
1183 </p>
1184 <div class="paragraph"><p>This option enables a check that verifies if the tip of the
1185 remote-tracking ref is reachable from one of the "reflog" entries of
1186 the local branch based in it for a rewrite. The check ensures that any
1187 updates from the remote have been incorporated locally by rejecting the
1188 forced update if that is not the case.</p></div>
1189 <div class="paragraph"><p>If the option is passed without specifying <code>--force-with-lease</code>, or
1190 specified along with <code>--force-with-lease=&lt;refname&gt;:&lt;expect&gt;</code>, it is
1191 a "no-op".</p></div>
1192 <div class="paragraph"><p>Specifying <code>--no-force-if-includes</code> disables this behavior.</p></div>
1193 </dd>
1194 <dt class="hdlist1">
1195 --repo=&lt;repository&gt;
1196 </dt>
1197 <dd>
1199 This option is equivalent to the &lt;repository&gt; argument. If both
1200 are specified, the command-line argument takes precedence.
1201 </p>
1202 </dd>
1203 <dt class="hdlist1">
1205 </dt>
1206 <dt class="hdlist1">
1207 --set-upstream
1208 </dt>
1209 <dd>
1211 For every branch that is up to date or successfully pushed, add
1212 upstream (tracking) reference, used by argument-less
1213 <a href="git-pull.html">git-pull(1)</a> and other commands. For more information,
1214 see <code>branch.&lt;name&gt;.merge</code> in <a href="git-config.html">git-config(1)</a>.
1215 </p>
1216 </dd>
1217 <dt class="hdlist1">
1218 --[no-]thin
1219 </dt>
1220 <dd>
1222 These options are passed to <a href="git-send-pack.html">git-send-pack(1)</a>. A thin transfer
1223 significantly reduces the amount of sent data when the sender and
1224 receiver share many of the same objects in common. The default is
1225 <code>--thin</code>.
1226 </p>
1227 </dd>
1228 <dt class="hdlist1">
1230 </dt>
1231 <dt class="hdlist1">
1232 --quiet
1233 </dt>
1234 <dd>
1236 Suppress all output, including the listing of updated refs,
1237 unless an error occurs. Progress is not reported to the standard
1238 error stream.
1239 </p>
1240 </dd>
1241 <dt class="hdlist1">
1243 </dt>
1244 <dt class="hdlist1">
1245 --verbose
1246 </dt>
1247 <dd>
1249 Run verbosely.
1250 </p>
1251 </dd>
1252 <dt class="hdlist1">
1253 --progress
1254 </dt>
1255 <dd>
1257 Progress status is reported on the standard error stream
1258 by default when it is attached to a terminal, unless -q
1259 is specified. This flag forces progress status even if the
1260 standard error stream is not directed to a terminal.
1261 </p>
1262 </dd>
1263 <dt class="hdlist1">
1264 --no-recurse-submodules
1265 </dt>
1266 <dt class="hdlist1">
1267 --recurse-submodules=check|on-demand|only|no
1268 </dt>
1269 <dd>
1271 May be used to make sure all submodule commits used by the
1272 revisions to be pushed are available on a remote-tracking branch.
1273 If <em>check</em> is used Git will verify that all submodule commits that
1274 changed in the revisions to be pushed are available on at least one
1275 remote of the submodule. If any commits are missing the push will
1276 be aborted and exit with non-zero status. If <em>on-demand</em> is used
1277 all submodules that changed in the revisions to be pushed will be
1278 pushed. If on-demand was not able to push all necessary revisions it will
1279 also be aborted and exit with non-zero status. If <em>only</em> is used all
1280 submodules will be recursively pushed while the superproject is left
1281 unpushed. A value of <em>no</em> or using <code>--no-recurse-submodules</code> can be used
1282 to override the push.recurseSubmodules configuration variable when no
1283 submodule recursion is required.
1284 </p>
1285 </dd>
1286 <dt class="hdlist1">
1287 --[no-]verify
1288 </dt>
1289 <dd>
1291 Toggle the pre-push hook (see <a href="githooks.html">githooks(5)</a>). The
1292 default is --verify, giving the hook a chance to prevent the
1293 push. With --no-verify, the hook is bypassed completely.
1294 </p>
1295 </dd>
1296 <dt class="hdlist1">
1298 </dt>
1299 <dt class="hdlist1">
1300 --ipv4
1301 </dt>
1302 <dd>
1304 Use IPv4 addresses only, ignoring IPv6 addresses.
1305 </p>
1306 </dd>
1307 <dt class="hdlist1">
1309 </dt>
1310 <dt class="hdlist1">
1311 --ipv6
1312 </dt>
1313 <dd>
1315 Use IPv6 addresses only, ignoring IPv4 addresses.
1316 </p>
1317 </dd>
1318 </dl></div>
1319 </div>
1320 </div>
1321 <div class="sect1">
1322 <h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2>
1323 <div class="sectionbody">
1324 <div class="paragraph"><p>In general, URLs contain information about the transport protocol, the
1325 address of the remote server, and the path to the repository.
1326 Depending on the transport protocol, some of this information may be
1327 absent.</p></div>
1328 <div class="paragraph"><p>Git supports ssh, git, http, and https protocols (in addition, ftp,
1329 and ftps can be used for fetching, but this is inefficient and
1330 deprecated; do not use it).</p></div>
1331 <div class="paragraph"><p>The native transport (i.e. git:// URL) does no authentication and
1332 should be used with caution on unsecured networks.</p></div>
1333 <div class="paragraph"><p>The following syntaxes may be used with them:</p></div>
1334 <div class="ulist"><ul>
1335 <li>
1337 ssh://&#91;user@&#93;host.xz&#91;:port&#93;/path/to/repo.git/
1338 </p>
1339 </li>
1340 <li>
1342 git://host.xz&#91;:port&#93;/path/to/repo.git/
1343 </p>
1344 </li>
1345 <li>
1347 http&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
1348 </p>
1349 </li>
1350 <li>
1352 ftp&#91;s&#93;://host.xz&#91;:port&#93;/path/to/repo.git/
1353 </p>
1354 </li>
1355 </ul></div>
1356 <div class="paragraph"><p>An alternative scp-like syntax may also be used with the ssh protocol:</p></div>
1357 <div class="ulist"><ul>
1358 <li>
1360 &#91;user@&#93;host.xz:path/to/repo.git/
1361 </p>
1362 </li>
1363 </ul></div>
1364 <div class="paragraph"><p>This syntax is only recognized if there are no slashes before the
1365 first colon. This helps differentiate a local path that contains a
1366 colon. For example the local path <code>foo:bar</code> could be specified as an
1367 absolute path or <code>./foo:bar</code> to avoid being misinterpreted as an ssh
1368 url.</p></div>
1369 <div class="paragraph"><p>The ssh and git protocols additionally support ~username expansion:</p></div>
1370 <div class="ulist"><ul>
1371 <li>
1373 ssh://&#91;user@&#93;host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1374 </p>
1375 </li>
1376 <li>
1378 git://host.xz&#91;:port&#93;/~&#91;user&#93;/path/to/repo.git/
1379 </p>
1380 </li>
1381 <li>
1383 &#91;user@&#93;host.xz:/~&#91;user&#93;/path/to/repo.git/
1384 </p>
1385 </li>
1386 </ul></div>
1387 <div class="paragraph"><p>For local repositories, also supported by Git natively, the following
1388 syntaxes may be used:</p></div>
1389 <div class="ulist"><ul>
1390 <li>
1392 /path/to/repo.git/
1393 </p>
1394 </li>
1395 <li>
1397 file:///path/to/repo.git/
1398 </p>
1399 </li>
1400 </ul></div>
1401 <div class="paragraph"><p>These two syntaxes are mostly equivalent, except when cloning, when
1402 the former implies --local option. See <a href="git-clone.html">git-clone(1)</a> for
1403 details.</p></div>
1404 <div class="paragraph"><p><em>git clone</em>, <em>git fetch</em> and <em>git pull</em>, but not <em>git push</em>, will also
1405 accept a suitable bundle file. See <a href="git-bundle.html">git-bundle(1)</a>.</p></div>
1406 <div class="paragraph"><p>When Git doesn&#8217;t know how to handle a certain transport protocol, it
1407 attempts to use the <em>remote-&lt;transport&gt;</em> remote helper, if one
1408 exists. To explicitly request a remote helper, the following syntax
1409 may be used:</p></div>
1410 <div class="ulist"><ul>
1411 <li>
1413 &lt;transport&gt;::&lt;address&gt;
1414 </p>
1415 </li>
1416 </ul></div>
1417 <div class="paragraph"><p>where &lt;address&gt; may be a path, a server and path, or an arbitrary
1418 URL-like string recognized by the specific remote helper being
1419 invoked. See <a href="gitremote-helpers.html">gitremote-helpers(7)</a> for details.</p></div>
1420 <div class="paragraph"><p>If there are a large number of similarly-named remote repositories and
1421 you want to use a different format for them (such that the URLs you
1422 use will be rewritten into URLs that work), you can create a
1423 configuration section of the form:</p></div>
1424 <div class="listingblock">
1425 <div class="content">
1426 <pre><code> [url "&lt;actual url base&gt;"]
1427 insteadOf = &lt;other url base&gt;</code></pre>
1428 </div></div>
1429 <div class="paragraph"><p>For example, with this:</p></div>
1430 <div class="listingblock">
1431 <div class="content">
1432 <pre><code> [url "git://git.host.xz/"]
1433 insteadOf = host.xz:/path/to/
1434 insteadOf = work:</code></pre>
1435 </div></div>
1436 <div class="paragraph"><p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
1437 rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div>
1438 <div class="paragraph"><p>If you want to rewrite URLs for push only, you can create a
1439 configuration section of the form:</p></div>
1440 <div class="listingblock">
1441 <div class="content">
1442 <pre><code> [url "&lt;actual url base&gt;"]
1443 pushInsteadOf = &lt;other url base&gt;</code></pre>
1444 </div></div>
1445 <div class="paragraph"><p>For example, with this:</p></div>
1446 <div class="listingblock">
1447 <div class="content">
1448 <pre><code> [url "ssh://example.org/"]
1449 pushInsteadOf = git://example.org/</code></pre>
1450 </div></div>
1451 <div class="paragraph"><p>a URL like "git://example.org/path/to/repo.git" will be rewritten to
1452 "ssh://example.org/path/to/repo.git" for pushes, but pulls will still
1453 use the original URL.</p></div>
1454 </div>
1455 </div>
1456 <div class="sect1">
1457 <h2 id="_remotes_a_id_remotes_a">REMOTES<a id="REMOTES"></a></h2>
1458 <div class="sectionbody">
1459 <div class="paragraph"><p>The name of one of the following can be used instead
1460 of a URL as <code>&lt;repository&gt;</code> argument:</p></div>
1461 <div class="ulist"><ul>
1462 <li>
1464 a remote in the Git configuration file: <code>$GIT_DIR/config</code>,
1465 </p>
1466 </li>
1467 <li>
1469 a file in the <code>$GIT_DIR/remotes</code> directory, or
1470 </p>
1471 </li>
1472 <li>
1474 a file in the <code>$GIT_DIR/branches</code> directory.
1475 </p>
1476 </li>
1477 </ul></div>
1478 <div class="paragraph"><p>All of these also allow you to omit the refspec from the command line
1479 because they each contain a refspec which git will use by default.</p></div>
1480 <div class="sect2">
1481 <h3 id="_named_remote_in_configuration_file">Named remote in configuration file</h3>
1482 <div class="paragraph"><p>You can choose to provide the name of a remote which you had previously
1483 configured using <a href="git-remote.html">git-remote(1)</a>, <a href="git-config.html">git-config(1)</a>
1484 or even by a manual edit to the <code>$GIT_DIR/config</code> file. The URL of
1485 this remote will be used to access the repository. The refspec
1486 of this remote will be used by default when you do
1487 not provide a refspec on the command line. The entry in the
1488 config file would appear like this:</p></div>
1489 <div class="listingblock">
1490 <div class="content">
1491 <pre><code> [remote "&lt;name&gt;"]
1492 url = &lt;URL&gt;
1493 pushurl = &lt;pushurl&gt;
1494 push = &lt;refspec&gt;
1495 fetch = &lt;refspec&gt;</code></pre>
1496 </div></div>
1497 <div class="paragraph"><p>The <code>&lt;pushurl&gt;</code> is used for pushes only. It is optional and defaults
1498 to <code>&lt;URL&gt;</code>.</p></div>
1499 </div>
1500 <div class="sect2">
1501 <h3 id="_named_file_in_code_git_dir_remotes_code">Named file in <code>$GIT_DIR/remotes</code></h3>
1502 <div class="paragraph"><p>You can choose to provide the name of a
1503 file in <code>$GIT_DIR/remotes</code>. The URL
1504 in this file will be used to access the repository. The refspec
1505 in this file will be used as default when you do not
1506 provide a refspec on the command line. This file should have the
1507 following format:</p></div>
1508 <div class="listingblock">
1509 <div class="content">
1510 <pre><code> URL: one of the above URL format
1511 Push: &lt;refspec&gt;
1512 Pull: &lt;refspec&gt;</code></pre>
1513 </div></div>
1514 <div class="paragraph"><p><code>Push:</code> lines are used by <em>git push</em> and
1515 <code>Pull:</code> lines are used by <em>git pull</em> and <em>git fetch</em>.
1516 Multiple <code>Push:</code> and <code>Pull:</code> lines may
1517 be specified for additional branch mappings.</p></div>
1518 </div>
1519 <div class="sect2">
1520 <h3 id="_named_file_in_code_git_dir_branches_code">Named file in <code>$GIT_DIR/branches</code></h3>
1521 <div class="paragraph"><p>You can choose to provide the name of a
1522 file in <code>$GIT_DIR/branches</code>.
1523 The URL in this file will be used to access the repository.
1524 This file should have the following format:</p></div>
1525 <div class="listingblock">
1526 <div class="content">
1527 <pre><code> &lt;URL&gt;#&lt;head&gt;</code></pre>
1528 </div></div>
1529 <div class="paragraph"><p><code>&lt;URL&gt;</code> is required; <code>#&lt;head&gt;</code> is optional.</p></div>
1530 <div class="paragraph"><p>Depending on the operation, git will use one of the following
1531 refspecs, if you don&#8217;t provide one on the command line.
1532 <code>&lt;branch&gt;</code> is the name of this file in <code>$GIT_DIR/branches</code> and
1533 <code>&lt;head&gt;</code> defaults to <code>master</code>.</p></div>
1534 <div class="paragraph"><p>git fetch uses:</p></div>
1535 <div class="listingblock">
1536 <div class="content">
1537 <pre><code> refs/heads/&lt;head&gt;:refs/heads/&lt;branch&gt;</code></pre>
1538 </div></div>
1539 <div class="paragraph"><p>git push uses:</p></div>
1540 <div class="listingblock">
1541 <div class="content">
1542 <pre><code> HEAD:refs/heads/&lt;head&gt;</code></pre>
1543 </div></div>
1544 </div>
1545 </div>
1546 </div>
1547 <div class="sect1">
1548 <h2 id="_output">OUTPUT</h2>
1549 <div class="sectionbody">
1550 <div class="paragraph"><p>The output of "git push" depends on the transport method used; this
1551 section describes the output when pushing over the Git protocol (either
1552 locally or via ssh).</p></div>
1553 <div class="paragraph"><p>The status of the push is output in tabular form, with each line
1554 representing the status of a single ref. Each line is of the form:</p></div>
1555 <div class="listingblock">
1556 <div class="content">
1557 <pre><code> &lt;flag&gt; &lt;summary&gt; &lt;from&gt; -&gt; &lt;to&gt; (&lt;reason&gt;)</code></pre>
1558 </div></div>
1559 <div class="paragraph"><p>If --porcelain is used, then each line of the output is of the form:</p></div>
1560 <div class="listingblock">
1561 <div class="content">
1562 <pre><code> &lt;flag&gt; \t &lt;from&gt;:&lt;to&gt; \t &lt;summary&gt; (&lt;reason&gt;)</code></pre>
1563 </div></div>
1564 <div class="paragraph"><p>The status of up-to-date refs is shown only if --porcelain or --verbose
1565 option is used.</p></div>
1566 <div class="dlist"><dl>
1567 <dt class="hdlist1">
1568 flag
1569 </dt>
1570 <dd>
1572 A single character indicating the status of the ref:
1573 </p>
1574 <div class="dlist"><dl>
1575 <dt class="hdlist1">
1576 (space)
1577 </dt>
1578 <dd>
1580 for a successfully pushed fast-forward;
1581 </p>
1582 </dd>
1583 <dt class="hdlist1">
1584 <code>+</code>
1585 </dt>
1586 <dd>
1588 for a successful forced update;
1589 </p>
1590 </dd>
1591 <dt class="hdlist1">
1592 <code>-</code>
1593 </dt>
1594 <dd>
1596 for a successfully deleted ref;
1597 </p>
1598 </dd>
1599 <dt class="hdlist1">
1600 <code>*</code>
1601 </dt>
1602 <dd>
1604 for a successfully pushed new ref;
1605 </p>
1606 </dd>
1607 <dt class="hdlist1">
1608 <code>!</code>
1609 </dt>
1610 <dd>
1612 for a ref that was rejected or failed to push; and
1613 </p>
1614 </dd>
1615 <dt class="hdlist1">
1616 <code>=</code>
1617 </dt>
1618 <dd>
1620 for a ref that was up to date and did not need pushing.
1621 </p>
1622 </dd>
1623 </dl></div>
1624 </dd>
1625 <dt class="hdlist1">
1626 summary
1627 </dt>
1628 <dd>
1630 For a successfully pushed ref, the summary shows the old and new
1631 values of the ref in a form suitable for using as an argument to
1632 <code>git log</code> (this is <code>&lt;old&gt;..&lt;new&gt;</code> in most cases, and
1633 <code>&lt;old&gt;...&lt;new&gt;</code> for forced non-fast-forward updates).
1634 </p>
1635 <div class="paragraph"><p>For a failed update, more details are given:</p></div>
1636 <div class="openblock">
1637 <div class="content">
1638 <div class="dlist"><dl>
1639 <dt class="hdlist1">
1640 rejected
1641 </dt>
1642 <dd>
1644 Git did not try to send the ref at all, typically because it
1645 is not a fast-forward and you did not force the update.
1646 </p>
1647 </dd>
1648 <dt class="hdlist1">
1649 remote rejected
1650 </dt>
1651 <dd>
1653 The remote end refused the update. Usually caused by a hook
1654 on the remote side, or because the remote repository has one
1655 of the following safety options in effect:
1656 <code>receive.denyCurrentBranch</code> (for pushes to the checked out
1657 branch), <code>receive.denyNonFastForwards</code> (for forced
1658 non-fast-forward updates), <code>receive.denyDeletes</code> or
1659 <code>receive.denyDeleteCurrent</code>. See <a href="git-config.html">git-config(1)</a>.
1660 </p>
1661 </dd>
1662 <dt class="hdlist1">
1663 remote failure
1664 </dt>
1665 <dd>
1667 The remote end did not report the successful update of the ref,
1668 perhaps because of a temporary error on the remote side, a
1669 break in the network connection, or other transient error.
1670 </p>
1671 </dd>
1672 </dl></div>
1673 </div></div>
1674 </dd>
1675 <dt class="hdlist1">
1676 from
1677 </dt>
1678 <dd>
1680 The name of the local ref being pushed, minus its
1681 <code>refs/&lt;type&gt;/</code> prefix. In the case of deletion, the
1682 name of the local ref is omitted.
1683 </p>
1684 </dd>
1685 <dt class="hdlist1">
1687 </dt>
1688 <dd>
1690 The name of the remote ref being updated, minus its
1691 <code>refs/&lt;type&gt;/</code> prefix.
1692 </p>
1693 </dd>
1694 <dt class="hdlist1">
1695 reason
1696 </dt>
1697 <dd>
1699 A human-readable explanation. In the case of successfully pushed
1700 refs, no explanation is needed. For a failed ref, the reason for
1701 failure is described.
1702 </p>
1703 </dd>
1704 </dl></div>
1705 </div>
1706 </div>
1707 <div class="sect1">
1708 <h2 id="_note_about_fast_forwards">NOTE ABOUT FAST-FORWARDS</h2>
1709 <div class="sectionbody">
1710 <div class="paragraph"><p>When an update changes a branch (or more in general, a ref) that used to
1711 point at commit A to point at another commit B, it is called a
1712 fast-forward update if and only if B is a descendant of A.</p></div>
1713 <div class="paragraph"><p>In a fast-forward update from A to B, the set of commits that the original
1714 commit A built on top of is a subset of the commits the new commit B
1715 builds on top of. Hence, it does not lose any history.</p></div>
1716 <div class="paragraph"><p>In contrast, a non-fast-forward update will lose history. For example,
1717 suppose you and somebody else started at the same commit X, and you built
1718 a history leading to commit B while the other person built a history
1719 leading to commit A. The history looks like this:</p></div>
1720 <div class="listingblock">
1721 <div class="content">
1722 <pre><code> B
1724 ---X---A</code></pre>
1725 </div></div>
1726 <div class="paragraph"><p>Further suppose that the other person already pushed changes leading to A
1727 back to the original repository from which you two obtained the original
1728 commit X.</p></div>
1729 <div class="paragraph"><p>The push done by the other person updated the branch that used to point at
1730 commit X to point at commit A. It is a fast-forward.</p></div>
1731 <div class="paragraph"><p>But if you try to push, you will attempt to update the branch (that
1732 now points at A) with commit B. This does <em>not</em> fast-forward. If you did
1733 so, the changes introduced by commit A will be lost, because everybody
1734 will now start building on top of B.</p></div>
1735 <div class="paragraph"><p>The command by default does not allow an update that is not a fast-forward
1736 to prevent such loss of history.</p></div>
1737 <div class="paragraph"><p>If you do not want to lose your work (history from X to B) or the work by
1738 the other person (history from X to A), you would need to first fetch the
1739 history from the repository, create a history that contains changes done
1740 by both parties, and push the result back.</p></div>
1741 <div class="paragraph"><p>You can perform "git pull", resolve potential conflicts, and "git push"
1742 the result. A "git pull" will create a merge commit C between commits A
1743 and B.</p></div>
1744 <div class="listingblock">
1745 <div class="content">
1746 <pre><code> B---C
1748 ---X---A</code></pre>
1749 </div></div>
1750 <div class="paragraph"><p>Updating A with the resulting merge commit will fast-forward and your
1751 push will be accepted.</p></div>
1752 <div class="paragraph"><p>Alternatively, you can rebase your change between X and B on top of A,
1753 with "git pull --rebase", and push the result back. The rebase will
1754 create a new commit D that builds the change between X and B on top of
1755 A.</p></div>
1756 <div class="listingblock">
1757 <div class="content">
1758 <pre><code> B D
1760 ---X---A</code></pre>
1761 </div></div>
1762 <div class="paragraph"><p>Again, updating A with this commit will fast-forward and your push will be
1763 accepted.</p></div>
1764 <div class="paragraph"><p>There is another common situation where you may encounter non-fast-forward
1765 rejection when you try to push, and it is possible even when you are
1766 pushing into a repository nobody else pushes into. After you push commit
1767 A yourself (in the first picture in this section), replace it with "git
1768 commit --amend" to produce commit B, and you try to push it out, because
1769 forgot that you have pushed A out already. In such a case, and only if
1770 you are certain that nobody in the meantime fetched your earlier commit A
1771 (and started building on top of it), you can run "git push --force" to
1772 overwrite it. In other words, "git push --force" is a method reserved for
1773 a case where you do mean to lose history.</p></div>
1774 </div>
1775 </div>
1776 <div class="sect1">
1777 <h2 id="_examples">EXAMPLES</h2>
1778 <div class="sectionbody">
1779 <div class="dlist"><dl>
1780 <dt class="hdlist1">
1781 <code>git push</code>
1782 </dt>
1783 <dd>
1785 Works like <code>git push &lt;remote&gt;</code>, where &lt;remote&gt; is the
1786 current branch&#8217;s remote (or <code>origin</code>, if no remote is
1787 configured for the current branch).
1788 </p>
1789 </dd>
1790 <dt class="hdlist1">
1791 <code>git push origin</code>
1792 </dt>
1793 <dd>
1795 Without additional configuration, pushes the current branch to
1796 the configured upstream (<code>branch.&lt;name&gt;.merge</code> configuration
1797 variable) if it has the same name as the current branch, and
1798 errors out without pushing otherwise.
1799 </p>
1800 <div class="paragraph"><p>The default behavior of this command when no &lt;refspec&gt; is given can be
1801 configured by setting the <code>push</code> option of the remote, or the <code>push.default</code>
1802 configuration variable.</p></div>
1803 <div class="paragraph"><p>For example, to default to pushing only the current branch to <code>origin</code>
1804 use <code>git config remote.origin.push HEAD</code>. Any valid &lt;refspec&gt; (like
1805 the ones in the examples below) can be configured as the default for
1806 <code>git push origin</code>.</p></div>
1807 </dd>
1808 <dt class="hdlist1">
1809 <code>git push origin :</code>
1810 </dt>
1811 <dd>
1813 Push "matching" branches to <code>origin</code>. See
1814 &lt;refspec&gt; in the <a href="#OPTIONS">OPTIONS</a> section above for a
1815 description of "matching" branches.
1816 </p>
1817 </dd>
1818 <dt class="hdlist1">
1819 <code>git push origin master</code>
1820 </dt>
1821 <dd>
1823 Find a ref that matches <code>master</code> in the source repository
1824 (most likely, it would find <code>refs/heads/master</code>), and update
1825 the same ref (e.g. <code>refs/heads/master</code>) in <code>origin</code> repository
1826 with it. If <code>master</code> did not exist remotely, it would be
1827 created.
1828 </p>
1829 </dd>
1830 <dt class="hdlist1">
1831 <code>git push origin HEAD</code>
1832 </dt>
1833 <dd>
1835 A handy way to push the current branch to the same name on the
1836 remote.
1837 </p>
1838 </dd>
1839 <dt class="hdlist1">
1840 <code>git push mothership master:satellite/master dev:satellite/dev</code>
1841 </dt>
1842 <dd>
1844 Use the source ref that matches <code>master</code> (e.g. <code>refs/heads/master</code>)
1845 to update the ref that matches <code>satellite/master</code> (most probably
1846 <code>refs/remotes/satellite/master</code>) in the <code>mothership</code> repository;
1847 do the same for <code>dev</code> and <code>satellite/dev</code>.
1848 </p>
1849 <div class="paragraph"><p>See the section describing <code>&lt;refspec&gt;...</code> above for a discussion of
1850 the matching semantics.</p></div>
1851 <div class="paragraph"><p>This is to emulate <code>git fetch</code> run on the <code>mothership</code> using <code>git
1852 push</code> that is run in the opposite direction in order to integrate
1853 the work done on <code>satellite</code>, and is often necessary when you can
1854 only make connection in one way (i.e. satellite can ssh into
1855 mothership but mothership cannot initiate connection to satellite
1856 because the latter is behind a firewall or does not run sshd).</p></div>
1857 <div class="paragraph"><p>After running this <code>git push</code> on the <code>satellite</code> machine, you would
1858 ssh into the <code>mothership</code> and run <code>git merge</code> there to complete the
1859 emulation of <code>git pull</code> that were run on <code>mothership</code> to pull changes
1860 made on <code>satellite</code>.</p></div>
1861 </dd>
1862 <dt class="hdlist1">
1863 <code>git push origin HEAD:master</code>
1864 </dt>
1865 <dd>
1867 Push the current branch to the remote ref matching <code>master</code> in the
1868 <code>origin</code> repository. This form is convenient to push the current
1869 branch without thinking about its local name.
1870 </p>
1871 </dd>
1872 <dt class="hdlist1">
1873 <code>git push origin master:refs/heads/experimental</code>
1874 </dt>
1875 <dd>
1877 Create the branch <code>experimental</code> in the <code>origin</code> repository
1878 by copying the current <code>master</code> branch. This form is only
1879 needed to create a new branch or tag in the remote repository when
1880 the local name and the remote name are different; otherwise,
1881 the ref name on its own will work.
1882 </p>
1883 </dd>
1884 <dt class="hdlist1">
1885 <code>git push origin :experimental</code>
1886 </dt>
1887 <dd>
1889 Find a ref that matches <code>experimental</code> in the <code>origin</code> repository
1890 (e.g. <code>refs/heads/experimental</code>), and delete it.
1891 </p>
1892 </dd>
1893 <dt class="hdlist1">
1894 <code>git push origin +dev:master</code>
1895 </dt>
1896 <dd>
1898 Update the origin repository&#8217;s master branch with the dev branch,
1899 allowing non-fast-forward updates. <strong>This can leave unreferenced
1900 commits dangling in the origin repository.</strong> Consider the
1901 following situation, where a fast-forward is not possible:
1902 </p>
1903 <div class="listingblock">
1904 <div class="content">
1905 <pre><code> o---o---o---A---B origin/master
1907 X---Y---Z dev</code></pre>
1908 </div></div>
1909 <div class="paragraph"><p>The above command would change the origin repository to</p></div>
1910 <div class="listingblock">
1911 <div class="content">
1912 <pre><code> A---B (unnamed branch)
1914 o---o---o---X---Y---Z master</code></pre>
1915 </div></div>
1916 <div class="paragraph"><p>Commits A and B would no longer belong to a branch with a symbolic name,
1917 and so would be unreachable. As such, these commits would be removed by
1918 a <code>git gc</code> command on the origin repository.</p></div>
1919 </dd>
1920 </dl></div>
1921 </div>
1922 </div>
1923 <div class="sect1">
1924 <h2 id="_security">SECURITY</h2>
1925 <div class="sectionbody">
1926 <div class="paragraph"><p>The fetch and push protocols are not designed to prevent one side from
1927 stealing data from the other repository that was not intended to be
1928 shared. If you have private data that you need to protect from a malicious
1929 peer, your best option is to store it in another repository. This applies
1930 to both clients and servers. In particular, namespaces on a server are not
1931 effective for read access control; you should only grant read access to a
1932 namespace to clients that you would trust with read access to the entire
1933 repository.</p></div>
1934 <div class="paragraph"><p>The known attack vectors are as follows:</p></div>
1935 <div class="olist arabic"><ol class="arabic">
1936 <li>
1938 The victim sends "have" lines advertising the IDs of objects it has that
1939 are not explicitly intended to be shared but can be used to optimize the
1940 transfer if the peer also has them. The attacker chooses an object ID X
1941 to steal and sends a ref to X, but isn&#8217;t required to send the content of
1942 X because the victim already has it. Now the victim believes that the
1943 attacker has X, and it sends the content of X back to the attacker
1944 later. (This attack is most straightforward for a client to perform on a
1945 server, by creating a ref to X in the namespace the client has access
1946 to and then fetching it. The most likely way for a server to perform it
1947 on a client is to "merge" X into a public branch and hope that the user
1948 does additional work on this branch and pushes it back to the server
1949 without noticing the merge.)
1950 </p>
1951 </li>
1952 <li>
1954 As in #1, the attacker chooses an object ID X to steal. The victim sends
1955 an object Y that the attacker already has, and the attacker falsely
1956 claims to have X and not Y, so the victim sends Y as a delta against X.
1957 The delta reveals regions of X that are similar to Y to the attacker.
1958 </p>
1959 </li>
1960 </ol></div>
1961 </div>
1962 </div>
1963 <div class="sect1">
1964 <h2 id="_configuration">CONFIGURATION</h2>
1965 <div class="sectionbody">
1966 <div class="paragraph"><p>Everything below this line in this section is selectively included
1967 from the <a href="git-config.html">git-config(1)</a> documentation. The content is the same
1968 as what&#8217;s found there:</p></div>
1969 <div class="dlist"><dl>
1970 <dt class="hdlist1">
1971 push.autoSetupRemote
1972 </dt>
1973 <dd>
1975 If set to "true" assume <code>--set-upstream</code> on default push when no
1976 upstream tracking exists for the current branch; this option
1977 takes effect with push.default options <em>simple</em>, <em>upstream</em>,
1978 and <em>current</em>. It is useful if by default you want new branches
1979 to be pushed to the default remote (like the behavior of
1980 <em>push.default=current</em>) and you also want the upstream tracking
1981 to be set. Workflows most likely to benefit from this option are
1982 <em>simple</em> central workflows where all branches are expected to
1983 have the same name on the remote.
1984 </p>
1985 </dd>
1986 <dt class="hdlist1">
1987 push.default
1988 </dt>
1989 <dd>
1991 Defines the action <code>git push</code> should take if no refspec is
1992 given (whether from the command-line, config, or elsewhere).
1993 Different values are well-suited for
1994 specific workflows; for instance, in a purely central workflow
1995 (i.e. the fetch source is equal to the push destination),
1996 <code>upstream</code> is probably what you want. Possible values are:
1997 </p>
1998 <div class="openblock">
1999 <div class="content">
2000 <div class="ulist"><ul>
2001 <li>
2003 <code>nothing</code> - do not push anything (error out) unless a refspec is
2004 given. This is primarily meant for people who want to
2005 avoid mistakes by always being explicit.
2006 </p>
2007 </li>
2008 <li>
2010 <code>current</code> - push the current branch to update a branch with the same
2011 name on the receiving end. Works in both central and non-central
2012 workflows.
2013 </p>
2014 </li>
2015 <li>
2017 <code>upstream</code> - push the current branch back to the branch whose
2018 changes are usually integrated into the current branch (which is
2019 called <code>@{upstream}</code>). This mode only makes sense if you are
2020 pushing to the same repository you would normally pull from
2021 (i.e. central workflow).
2022 </p>
2023 </li>
2024 <li>
2026 <code>tracking</code> - This is a deprecated synonym for <code>upstream</code>.
2027 </p>
2028 </li>
2029 <li>
2031 <code>simple</code> - pushes the current branch with the same name on the remote.
2032 </p>
2033 <div class="paragraph"><p>If you are working on a centralized workflow (pushing to the same repository you
2034 pull from, which is typically <code>origin</code>), then you need to configure an upstream
2035 branch with the same name.</p></div>
2036 <div class="paragraph"><p>This mode is the default since Git 2.0, and is the safest option suited for
2037 beginners.</p></div>
2038 </li>
2039 <li>
2041 <code>matching</code> - push all branches having the same name on both ends.
2042 This makes the repository you are pushing to remember the set of
2043 branches that will be pushed out (e.g. if you always push <em>maint</em>
2044 and <em>master</em> there and no other branches, the repository you push
2045 to will have these two branches, and your local <em>maint</em> and
2046 <em>master</em> will be pushed there).
2047 </p>
2048 <div class="paragraph"><p>To use this mode effectively, you have to make sure <em>all</em> the
2049 branches you would push out are ready to be pushed out before
2050 running <em>git push</em>, as the whole point of this mode is to allow you
2051 to push all of the branches in one go. If you usually finish work
2052 on only one branch and push out the result, while other branches are
2053 unfinished, this mode is not for you. Also this mode is not
2054 suitable for pushing into a shared central repository, as other
2055 people may add new branches there, or update the tip of existing
2056 branches outside your control.</p></div>
2057 <div class="paragraph"><p>This used to be the default, but not since Git 2.0 (<code>simple</code> is the
2058 new default).</p></div>
2059 </li>
2060 </ul></div>
2061 </div></div>
2062 </dd>
2063 <dt class="hdlist1">
2064 push.followTags
2065 </dt>
2066 <dd>
2068 If set to true enable <code>--follow-tags</code> option by default. You
2069 may override this configuration at time of push by specifying
2070 <code>--no-follow-tags</code>.
2071 </p>
2072 </dd>
2073 <dt class="hdlist1">
2074 push.gpgSign
2075 </dt>
2076 <dd>
2078 May be set to a boolean value, or the string <em>if-asked</em>. A true
2079 value causes all pushes to be GPG signed, as if <code>--signed</code> is
2080 passed to <a href="git-push.html">git-push(1)</a>. The string <em>if-asked</em> causes
2081 pushes to be signed if the server supports it, as if
2082 <code>--signed=if-asked</code> is passed to <em>git push</em>. A false value may
2083 override a value from a lower-priority config file. An explicit
2084 command-line flag always overrides this config option.
2085 </p>
2086 </dd>
2087 <dt class="hdlist1">
2088 push.pushOption
2089 </dt>
2090 <dd>
2092 When no <code>--push-option=&lt;option&gt;</code> argument is given from the
2093 command line, <code>git push</code> behaves as if each &lt;value&gt; of
2094 this variable is given as <code>--push-option=&lt;value&gt;</code>.
2095 </p>
2096 <div class="paragraph"><p>This is a multi-valued variable, and an empty value can be used in a
2097 higher priority configuration file (e.g. <code>.git/config</code> in a
2098 repository) to clear the values inherited from a lower priority
2099 configuration files (e.g. <code>$HOME/.gitconfig</code>).</p></div>
2100 <div class="listingblock">
2101 <div class="content">
2102 <pre><code>Example:
2104 /etc/gitconfig
2105 push.pushoption = a
2106 push.pushoption = b
2108 ~/.gitconfig
2109 push.pushoption = c
2111 repo/.git/config
2112 push.pushoption =
2113 push.pushoption = b
2115 This will result in only b (a and c are cleared).</code></pre>
2116 </div></div>
2117 </dd>
2118 <dt class="hdlist1">
2119 push.recurseSubmodules
2120 </dt>
2121 <dd>
2123 Make sure all submodule commits used by the revisions to be pushed
2124 are available on a remote-tracking branch. If the value is <em>check</em>
2125 then Git will verify that all submodule commits that changed in the
2126 revisions to be pushed are available on at least one remote of the
2127 submodule. If any commits are missing, the push will be aborted and
2128 exit with non-zero status. If the value is <em>on-demand</em> then all
2129 submodules that changed in the revisions to be pushed will be
2130 pushed. If on-demand was not able to push all necessary revisions
2131 it will also be aborted and exit with non-zero status. If the value
2132 is <em>no</em> then default behavior of ignoring submodules when pushing
2133 is retained. You may override this configuration at time of push by
2134 specifying <em>--recurse-submodules=check|on-demand|no</em>.
2135 If not set, <em>no</em> is used by default, unless <em>submodule.recurse</em> is
2136 set (in which case a <em>true</em> value means <em>on-demand</em>).
2137 </p>
2138 </dd>
2139 <dt class="hdlist1">
2140 push.useForceIfIncludes
2141 </dt>
2142 <dd>
2144 If set to "true", it is equivalent to specifying
2145 <code>--force-if-includes</code> as an option to <a href="git-push.html">git-push(1)</a>
2146 in the command line. Adding <code>--no-force-if-includes</code> at the
2147 time of push overrides this configuration setting.
2148 </p>
2149 </dd>
2150 <dt class="hdlist1">
2151 push.negotiate
2152 </dt>
2153 <dd>
2155 If set to "true", attempt to reduce the size of the packfile
2156 sent by rounds of negotiation in which the client and the
2157 server attempt to find commits in common. If "false", Git will
2158 rely solely on the server&#8217;s ref advertisement to find commits
2159 in common.
2160 </p>
2161 </dd>
2162 <dt class="hdlist1">
2163 push.useBitmaps
2164 </dt>
2165 <dd>
2167 If set to "false", disable use of bitmaps for "git push" even if
2168 <code>pack.useBitmaps</code> is "true", without preventing other git operations
2169 from using bitmaps. Default is true.
2170 </p>
2171 </dd>
2172 </dl></div>
2173 </div>
2174 </div>
2175 <div class="sect1">
2176 <h2 id="_git">GIT</h2>
2177 <div class="sectionbody">
2178 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
2179 </div>
2180 </div>
2181 </div>
2182 <div id="footnotes"><hr /></div>
2183 <div id="footer">
2184 <div id="footer-text">
2185 Last updated
2186 2022-09-14 13:23:11 PDT
2187 </div>
2188 </div>
2189 </body>
2190 </html>