Autogenerated HTML docs for v1.7.7-419-g87009
[git/jnareb-git.git] / git-submodule.html
blob8bfcd32a42ab70da1ce2e77e06a79eb62efbc88c
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.5.2" />
7 <title>git-submodule(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.0em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
131 div.content { /* Block element content. */
132 padding: 0;
135 /* Block element titles. */
136 div.title, caption.title {
137 color: #527bbd;
138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
144 div.title + * {
145 margin-top: 0;
148 td div.title:first-child {
149 margin-top: 0.0em;
151 div.content div.title:first-child {
152 margin-top: 0.0em;
154 div.content + div.title {
155 margin-top: 0.0em;
158 div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
164 div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
170 div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
173 margin-right: 10%;
174 border-left: 5px solid #dddddd;
175 color: #777777;
178 div.quoteblock > div.attribution {
179 padding-top: 0.5em;
180 text-align: right;
183 div.verseblock > div.content {
184 white-space: pre;
186 div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div.verseblock + div.attribution {
192 text-align: left;
195 div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
203 div.admonitionblock td.content {
204 padding-left: 0.5em;
205 border-left: 3px solid #dddddd;
208 div.exampleblock > div.content {
209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
213 div.imageblock div.content { padding-left: 0; }
214 span.image img { border-style: none; }
215 a.image:visited { color: white; }
217 dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
221 dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
224 font-style: normal;
225 color: navy;
227 dd > *:first-child {
228 margin-top: 0.1em;
231 ul, ol {
232 list-style-position: outside;
234 ol.arabic {
235 list-style-type: decimal;
237 ol.loweralpha {
238 list-style-type: lower-alpha;
240 ol.upperalpha {
241 list-style-type: upper-alpha;
243 ol.lowerroman {
244 list-style-type: lower-roman;
246 ol.upperroman {
247 list-style-type: upper-roman;
250 div.compact ul, div.compact ol,
251 div.compact p, div.compact p,
252 div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
257 div.tableblock > table {
258 border: 3px solid #527bbd;
260 thead, p.table.header {
261 font-family: sans-serif;
262 font-weight: bold;
264 tfoot {
265 font-weight: bold;
267 td > div.verse {
268 white-space: pre;
270 p.table {
271 margin-top: 0;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div.tableblock > table[frame="void"] {
275 border-style: none;
277 div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
281 div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
287 div.hdlist {
288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
291 div.hdlist tr {
292 padding-bottom: 15px;
294 dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
297 td.hdlist1 {
298 vertical-align: top;
299 font-style: normal;
300 padding-right: 0.8em;
301 color: navy;
303 td.hdlist2 {
304 vertical-align: top;
306 div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
311 .comment {
312 background: yellow;
315 .footnote, .footnoteref {
316 font-size: 0.8em;
319 span.footnote, span.footnoteref {
320 vertical-align: super;
323 #footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
328 #footnotes div.footnote {
329 margin: 0 0 5px 0;
332 #footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
343 @media print {
344 div#footer-badges { display: none; }
347 div#toc {
348 margin-bottom: 2.5em;
351 div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
360 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
364 div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
368 div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
372 div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
376 /* Overrides for manpage documents */
377 h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
383 h2 {
384 border-style: none;
386 div.sectionbody {
387 margin-left: 5%;
390 @media print {
391 div#toc { display: none; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
401 div.sidebar-title, div.image-title {
402 color: #527bbd;
403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
409 div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
415 div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
420 div.verseblock-content {
421 white-space: pre;
423 div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
428 div.exampleblock-content {
429 border-left: 3px solid #dddddd;
430 padding-left: 0.5em;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc a:visited { color: blue; }
435 </style>
436 <script type="text/javascript">
437 /*<![CDATA[*/
438 window.onload = function(){asciidoc.footnotes();}
439 var asciidoc = { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
449 * Version: 0.4
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
458 // toclevels = 1..4.
459 toc: function (toclevels) {
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
469 return text;
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
491 iterate(i);
495 iterate(el);
496 return result;
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
567 /*]]>*/
568 </script>
569 </head>
570 <body>
571 <div id="header">
572 <h1>
573 git-submodule(1) Manual Page
574 </h1>
575 <h2>NAME</h2>
576 <div class="sectionbody">
577 <p>git-submodule -
578 Initialize, update or inspect submodules
579 </p>
580 </div>
581 </div>
582 <div id="content">
583 <h2 id="_synopsis">SYNOPSIS</h2>
584 <div class="sectionbody">
585 <div class="verseblock">
586 <div class="verseblock-content"><em>git submodule</em> [--quiet] add [-b branch] [-f|--force]
587 [--reference &lt;repository&gt;] [--] &lt;repository&gt; [&lt;path&gt;]
588 <em>git submodule</em> [--quiet] status [--cached] [--recursive] [--] [&lt;path&gt;&#8230;]
589 <em>git submodule</em> [--quiet] init [--] [&lt;path&gt;&#8230;]
590 <em>git submodule</em> [--quiet] update [--init] [-N|--no-fetch] [--rebase]
591 [--reference &lt;repository&gt;] [--merge] [--recursive] [--] [&lt;path&gt;&#8230;]
592 <em>git submodule</em> [--quiet] summary [--cached|--files] [(-n|--summary-limit) &lt;n&gt;]
593 [commit] [--] [&lt;path&gt;&#8230;]
594 <em>git submodule</em> [--quiet] foreach [--recursive] &lt;command&gt;
595 <em>git submodule</em> [--quiet] sync [--] [&lt;path&gt;&#8230;]</div>
596 <div class="verseblock-attribution">
597 </div></div>
598 </div>
599 <h2 id="_description">DESCRIPTION</h2>
600 <div class="sectionbody">
601 <div class="paragraph"><p>Submodules allow foreign repositories to be embedded within
602 a dedicated subdirectory of the source tree, always pointed
603 at a particular commit.</p></div>
604 <div class="paragraph"><p>They are not to be confused with remotes, which are meant mainly
605 for branches of the same project; submodules are meant for
606 different projects you would like to make part of your source tree,
607 while the history of the two projects still stays completely
608 independent and you cannot modify the contents of the submodule
609 from within the main project.
610 If you want to merge the project histories and want to treat the
611 aggregated whole as a single project from then on, you may want to
612 add a remote for the other project and use the <em>subtree</em> merge strategy,
613 instead of treating the other project as a submodule. Directories
614 that come from both projects can be cloned and checked out as a whole
615 if you choose to go that route.</p></div>
616 <div class="paragraph"><p>Submodules are composed from a so-called <tt>gitlink</tt> tree entry
617 in the main repository that refers to a particular commit object
618 within the inner repository that is completely separate.
619 A record in the <tt>.gitmodules</tt> file at the root of the source
620 tree assigns a logical name to the submodule and describes
621 the default URL the submodule shall be cloned from.
622 The logical name can be used for overriding this URL within your
623 local repository configuration (see <em>submodule init</em>).</p></div>
624 <div class="paragraph"><p>This command will manage the tree entries and contents of the
625 gitmodules file for you, as well as inspect the status of your
626 submodules and update them.
627 When adding a new submodule to the tree, the <em>add</em> subcommand
628 is to be used. However, when pulling a tree containing submodules,
629 these will not be checked out by default;
630 the <em>init</em> and <em>update</em> subcommands will maintain submodules
631 checked out and at appropriate revision in your working tree.
632 You can briefly inspect the up-to-date status of your submodules
633 using the <em>status</em> subcommand and get a detailed overview of the
634 difference between the index and checkouts using the <em>summary</em>
635 subcommand.</p></div>
636 </div>
637 <h2 id="_commands">COMMANDS</h2>
638 <div class="sectionbody">
639 <div class="dlist"><dl>
640 <dt class="hdlist1">
642 </dt>
643 <dd>
645 Add the given repository as a submodule at the given path
646 to the changeset to be committed next to the current
647 project: the current project is termed the "superproject".
648 </p>
649 <div class="paragraph"><p>This requires at least one argument: &lt;repository&gt;. The optional
650 argument &lt;path&gt; is the relative location for the cloned submodule
651 to exist in the superproject. If &lt;path&gt; is not given, the
652 "humanish" part of the source repository is used ("repo" for
653 "/path/to/repo.git" and "foo" for "host.xz:foo/.git").</p></div>
654 <div class="paragraph"><p>&lt;repository&gt; is the URL of the new submodule&#8217;s origin repository.
655 This may be either an absolute URL, or (if it begins with ./
656 or ../), the location relative to the superproject&#8217;s origin
657 repository. If the superproject doesn&#8217;t have an origin configured
658 the superproject is its own authoritative upstream and the current
659 working directory is used instead.</p></div>
660 <div class="paragraph"><p>&lt;path&gt; is the relative location for the cloned submodule to
661 exist in the superproject. If &lt;path&gt; does not exist, then the
662 submodule is created by cloning from the named URL. If &lt;path&gt; does
663 exist and is already a valid git repository, then this is added
664 to the changeset without cloning. This second form is provided
665 to ease creating a new submodule from scratch, and presumes
666 the user will later push the submodule to the given URL.</p></div>
667 <div class="paragraph"><p>In either case, the given URL is recorded into .gitmodules for
668 use by subsequent users cloning the superproject. If the URL is
669 given relative to the superproject&#8217;s repository, the presumption
670 is the superproject and submodule repositories will be kept
671 together in the same relative location, and only the
672 superproject&#8217;s URL needs to be provided: git-submodule will correctly
673 locate the submodule using the relative URL in .gitmodules.</p></div>
674 </dd>
675 <dt class="hdlist1">
676 status
677 </dt>
678 <dd>
680 Show the status of the submodules. This will print the SHA-1 of the
681 currently checked out commit for each submodule, along with the
682 submodule path and the output of <em>git describe</em> for the
683 SHA-1. Each SHA-1 will be prefixed with <tt>-</tt> if the submodule is not
684 initialized, <tt>+</tt> if the currently checked out submodule commit
685 does not match the SHA-1 found in the index of the containing
686 repository and <tt>U</tt> if the submodule has merge conflicts.
687 This command is the default command for <em>git submodule</em>.
688 </p>
689 <div class="paragraph"><p>If <tt>--recursive</tt> is specified, this command will recurse into nested
690 submodules, and show their status as well.</p></div>
691 <div class="paragraph"><p>If you are only interested in changes of the currently initialized
692 submodules with respect to the commit recorded in the index or the HEAD,
693 <a href="git-status.html">git-status(1)</a> and <a href="git-diff.html">git-diff(1)</a> will provide that information
694 too (and can also report changes to a submodule&#8217;s work tree).</p></div>
695 </dd>
696 <dt class="hdlist1">
697 init
698 </dt>
699 <dd>
701 Initialize the submodules, i.e. register each submodule name
702 and url found in .gitmodules into .git/config.
703 It will also copy the value of <tt>submodule.$name.update</tt> into
704 .git/config.
705 The key used in .git/config is <tt>submodule.$name.url</tt>.
706 This command does not alter existing information in .git/config.
707 You can then customize the submodule clone URLs in .git/config
708 for your local setup and proceed to <tt>git submodule update</tt>;
709 you can also just use <tt>git submodule update --init</tt> without
710 the explicit <em>init</em> step if you do not intend to customize
711 any submodule locations.
712 </p>
713 </dd>
714 <dt class="hdlist1">
715 update
716 </dt>
717 <dd>
719 Update the registered submodules, i.e. clone missing submodules and
720 checkout the commit specified in the index of the containing repository.
721 This will make the submodules HEAD be detached unless <tt>--rebase</tt> or
722 <tt>--merge</tt> is specified or the key <tt>submodule.$name.update</tt> is set to
723 <tt>rebase</tt>, <tt>merge</tt> or <tt>none</tt>.
724 </p>
725 <div class="paragraph"><p>If the submodule is not yet initialized, and you just want to use the
726 setting as stored in .gitmodules, you can automatically initialize the
727 submodule with the <tt>--init</tt> option.</p></div>
728 <div class="paragraph"><p>If <tt>--recursive</tt> is specified, this command will recurse into the
729 registered submodules, and update any nested submodules within.</p></div>
730 <div class="paragraph"><p>If the configuration key <tt>submodule.$name.update</tt> is set to <tt>none</tt> the
731 submodule with name <tt>$name</tt> will not be updated by default. This can be
732 overriden by adding <tt>--checkout</tt> to the command.</p></div>
733 </dd>
734 <dt class="hdlist1">
735 summary
736 </dt>
737 <dd>
739 Show commit summary between the given commit (defaults to HEAD) and
740 working tree/index. For a submodule in question, a series of commits
741 in the submodule between the given super project commit and the
742 index or working tree (switched by <tt>--cached</tt>) are shown. If the option
743 <tt>--files</tt> is given, show the series of commits in the submodule between
744 the index of the super project and the working tree of the submodule
745 (this option doesn&#8217;t allow to use the <tt>--cached</tt> option or to provide an
746 explicit commit).
747 </p>
748 <div class="paragraph"><p>Using the <tt>--submodule=log</tt> option with <a href="git-diff.html">git-diff(1)</a> will provide that
749 information too.</p></div>
750 </dd>
751 <dt class="hdlist1">
752 foreach
753 </dt>
754 <dd>
756 Evaluates an arbitrary shell command in each checked out submodule.
757 The command has access to the variables $name, $path, $sha1 and
758 $toplevel:
759 $name is the name of the relevant submodule section in .gitmodules,
760 $path is the name of the submodule directory relative to the
761 superproject, $sha1 is the commit as recorded in the superproject,
762 and $toplevel is the absolute path to the top-level of the superproject.
763 Any submodules defined in the superproject but not checked out are
764 ignored by this command. Unless given <tt>--quiet</tt>, foreach prints the name
765 of each submodule before evaluating the command.
766 If <tt>--recursive</tt> is given, submodules are traversed recursively (i.e.
767 the given shell command is evaluated in nested submodules as well).
768 A non-zero return from the command in any submodule causes
769 the processing to terminate. This can be overridden by adding <em>|| :</em>
770 to the end of the command.
771 </p>
772 <div class="paragraph"><p>As an example, <tt>git submodule foreach 'echo $path &#96;git
773 rev-parse HEAD&#96;'</tt> will show the path and currently checked out
774 commit for each submodule.</p></div>
775 </dd>
776 <dt class="hdlist1">
777 sync
778 </dt>
779 <dd>
781 Synchronizes submodules' remote URL configuration setting
782 to the value specified in .gitmodules. It will only affect those
783 submodules which already have an url entry in .git/config (that is the
784 case when they are initialized or freshly added). This is useful when
785 submodule URLs change upstream and you need to update your local
786 repositories accordingly.
787 </p>
788 <div class="paragraph"><p>"git submodule sync" synchronizes all submodules while
789 "git submodule sync -- A" synchronizes submodule "A" only.</p></div>
790 </dd>
791 </dl></div>
792 </div>
793 <h2 id="_options">OPTIONS</h2>
794 <div class="sectionbody">
795 <div class="dlist"><dl>
796 <dt class="hdlist1">
798 </dt>
799 <dt class="hdlist1">
800 --quiet
801 </dt>
802 <dd>
804 Only print error messages.
805 </p>
806 </dd>
807 <dt class="hdlist1">
809 </dt>
810 <dt class="hdlist1">
811 --branch
812 </dt>
813 <dd>
815 Branch of repository to add as submodule.
816 </p>
817 </dd>
818 <dt class="hdlist1">
820 </dt>
821 <dt class="hdlist1">
822 --force
823 </dt>
824 <dd>
826 This option is only valid for add and update commands.
827 When running add, allow adding an otherwise ignored submodule path.
828 When running update, throw away local changes in submodules when
829 switching to a different commit.
830 </p>
831 </dd>
832 <dt class="hdlist1">
833 --cached
834 </dt>
835 <dd>
837 This option is only valid for status and summary commands. These
838 commands typically use the commit found in the submodule HEAD, but
839 with this option, the commit stored in the index is used instead.
840 </p>
841 </dd>
842 <dt class="hdlist1">
843 --files
844 </dt>
845 <dd>
847 This option is only valid for the summary command. This command
848 compares the commit in the index with that in the submodule HEAD
849 when this option is used.
850 </p>
851 </dd>
852 <dt class="hdlist1">
854 </dt>
855 <dt class="hdlist1">
856 --summary-limit
857 </dt>
858 <dd>
860 This option is only valid for the summary command.
861 Limit the summary size (number of commits shown in total).
862 Giving 0 will disable the summary; a negative number means unlimited
863 (the default). This limit only applies to modified submodules. The
864 size is always limited to 1 for added/deleted/typechanged submodules.
865 </p>
866 </dd>
867 <dt class="hdlist1">
869 </dt>
870 <dt class="hdlist1">
871 --no-fetch
872 </dt>
873 <dd>
875 This option is only valid for the update command.
876 Don&#8217;t fetch new objects from the remote site.
877 </p>
878 </dd>
879 <dt class="hdlist1">
880 --merge
881 </dt>
882 <dd>
884 This option is only valid for the update command.
885 Merge the commit recorded in the superproject into the current branch
886 of the submodule. If this option is given, the submodule&#8217;s HEAD will
887 not be detached. If a merge failure prevents this process, you will
888 have to resolve the resulting conflicts within the submodule with the
889 usual conflict resolution tools.
890 If the key <tt>submodule.$name.update</tt> is set to <tt>merge</tt>, this option is
891 implicit.
892 </p>
893 </dd>
894 <dt class="hdlist1">
895 --rebase
896 </dt>
897 <dd>
899 This option is only valid for the update command.
900 Rebase the current branch onto the commit recorded in the
901 superproject. If this option is given, the submodule&#8217;s HEAD will not
902 be detached. If a merge failure prevents this process, you will have
903 to resolve these failures with <a href="git-rebase.html">git-rebase(1)</a>.
904 If the key <tt>submodule.$name.update</tt> is set to <tt>rebase</tt>, this option is
905 implicit.
906 </p>
907 </dd>
908 <dt class="hdlist1">
909 --init
910 </dt>
911 <dd>
913 This option is only valid for the update command.
914 Initialize all submodules for which "git submodule init" has not been
915 called so far before updating.
916 </p>
917 </dd>
918 <dt class="hdlist1">
919 --reference &lt;repository&gt;
920 </dt>
921 <dd>
923 This option is only valid for add and update commands. These
924 commands sometimes need to clone a remote repository. In this case,
925 this option will be passed to the <a href="git-clone.html">git-clone(1)</a> command.
926 </p>
927 <div class="paragraph"><p><strong>NOTE</strong>: Do <strong>not</strong> use this option unless you have read the note
928 for <a href="git-clone.html">git-clone(1)</a>'s <tt>--reference</tt> and <tt>--shared</tt> options carefully.</p></div>
929 </dd>
930 <dt class="hdlist1">
931 --recursive
932 </dt>
933 <dd>
935 This option is only valid for foreach, update and status commands.
936 Traverse submodules recursively. The operation is performed not
937 only in the submodules of the current repo, but also
938 in any nested submodules inside those submodules (and so on).
939 </p>
940 </dd>
941 <dt class="hdlist1">
942 &lt;path&gt;&#8230;
943 </dt>
944 <dd>
946 Paths to submodule(s). When specified this will restrict the command
947 to only operate on the submodules found at the specified paths.
948 (This argument is required with add).
949 </p>
950 </dd>
951 </dl></div>
952 </div>
953 <h2 id="_files">FILES</h2>
954 <div class="sectionbody">
955 <div class="paragraph"><p>When initializing submodules, a .gitmodules file in the top-level directory
956 of the containing repository is used to find the url of each submodule.
957 This file should be formatted in the same way as <tt>$GIT_DIR/config</tt>. The key
958 to each submodule url is "submodule.$name.url". See <a href="gitmodules.html">gitmodules(5)</a>
959 for details.</p></div>
960 </div>
961 <h2 id="_git">GIT</h2>
962 <div class="sectionbody">
963 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
964 </div>
965 </div>
966 <div id="footnotes"><hr /></div>
967 <div id="footer">
968 <div id="footer-text">
969 Last updated 2011-10-10 16:42:04 PDT
970 </div>
971 </div>
972 </body>
973 </html>