CINXE.COM
Git - gitmodules Documentation
<!DOCTYPE html> <html lang="en"> <head> <script type="text/javascript"> const currentTheme = localStorage.getItem("theme") if (currentTheme) { const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)").matches if ((prefersDarkScheme && currentTheme === "light") || (!prefersDarkScheme && currentTheme === "dark")) { document.documentElement.dataset.theme = currentTheme } } </script> <meta charset='utf-8'> <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Git - gitmodules Documentation</title> <link href="/favicon.ico" rel='shortcut icon' type='image/x-icon'> <link rel="stylesheet" href="/application.min.css"> </head> <body id="documentation"> <div class="inner"> <header> <a id="logo" href="/"><img src="/images/logo@2x.png" width="110" height="46" alt="Git" class="no-filter" /></a> <span id="tagline"></span> <script type="text/javascript"> const taglines = [ "fast-version-control", "everything-is-local", "distributed-even-if-your-workflow-isnt", "local-branching-on-the-cheap", "distributed-is-the-new-centralized" ]; var tagline = taglines[Math.floor(Math.random() * taglines.length)]; document.getElementById('tagline').innerHTML = '--' + tagline; </script> <div id="search-container"> <form id="search" action="/search/results"> <input id="search-text" name="search" placeholder="Type / to search entire site…" autocomplete="off" type="text" /> </form> <div id="search-results"></div> </div> <img src="/images/dark-mode.svg" id="dark-mode-button" /> </header> </div> <div class="inner"> <div id="content-wrapper"> <div tabindex="1" class="sidebar-btn"></div> <aside class="sidebar" id="sidebar"> <nav> <ul> <li> <a href="/about">About</a> <ul> </ul> </li> <li> <a href="/doc" class="active">Documentation</a> <ul class="expanded"> <li> <a href="/docs" class="active">Reference</a> </li> <li> <a href="/book">Book</a> </li> <li> <a href="/videos">Videos</a> </li> <li> <a href="/doc/ext">External Links</a> </li> </ul> </li> <li> <a href="/downloads">Downloads</a> <ul > <li> <a href="/downloads/guis">GUI Clients</a> </li> <li> <a href="/downloads/logos">Logos</a> </li> </ul> </li> <li> <a href="/community">Community</a> </li> </ul> </nav> </aside> <div id="content"> <div id='reference-version'> <a class="dropdown-trigger" id="reference-languages-trigger" data-panel-id="l10n-versions-dropdown" href="#"> English ▾</a> <div class='dropdown-panel right' id='l10n-versions-dropdown'> <header>Localized versions of <strong>gitmodules</strong> manual</header> <ol class='reference-previous-versions'> <li> <a href="/docs/gitmodules"><span class="version">English</span> </a> </li> </ol> <footer> Want to read in your language or fix typos?<br/> <a href="https://github.com/jnavila/git-manpages-l10n">You can help translate this page</a>. </footer> </div> <a class="dropdown-trigger" id="reference-topics-trigger" data-panel-id="topics-dropdown" href="#">Topics ▾</a> <div class='dropdown-panel right' id='topics-dropdown'> <div class='three-column'> <div class='column-left'> <h3 class='setup'>Setup and Config</h3> <ul class='unstyled'> <li> <a href="/docs/git"> git </a> </li> <li> <a href="/docs/git-config"> config </a> </li> <li> <a href="/docs/git-help"> help </a> </li> <li> <a href="/docs/git-bugreport"> bugreport </a> </li> <li> <a href="/doc/credential-helpers"> Credential helpers </a> </li> </ul> <h3 class='projects'>Getting and Creating Projects</h3> <ul class='unstyled'> <li> <a href="/docs/git-init"> init </a> </li> <li> <a href="/docs/git-clone"> clone </a> </li> </ul> <h3 class='snapshotting'>Basic Snapshotting</h3> <ul class='unstyled'> <li> <a href="/docs/git-add"> add </a> </li> <li> <a href="/docs/git-status"> status </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-commit"> commit </a> </li> <li> <a href="/docs/git-notes"> notes </a> </li> <li> <a href="/docs/git-restore"> restore </a> </li> <li> <a href="/docs/git-reset"> reset </a> </li> <li> <a href="/docs/git-rm"> rm </a> </li> <li> <a href="/docs/git-mv"> mv </a> </li> </ul> <h3 class='branching'>Branching and Merging</h3> <ul class='unstyled'> <li> <a href="/docs/git-branch"> branch </a> </li> <li> <a href="/docs/git-checkout"> checkout </a> </li> <li> <a href="/docs/git-switch"> switch </a> </li> <li> <a href="/docs/git-merge"> merge </a> </li> <li> <a href="/docs/git-mergetool"> mergetool </a> </li> <li> <a href="/docs/git-log"> log </a> </li> <li> <a href="/docs/git-stash"> stash </a> </li> <li> <a href="/docs/git-tag"> tag </a> </li> <li> <a href="/docs/git-worktree"> worktree </a> </li> </ul> <h3 class='sharing'>Sharing and Updating Projects</h3> <ul class='unstyled'> <li> <a href="/docs/git-fetch"> fetch </a> </li> <li> <a href="/docs/git-pull"> pull </a> </li> <li> <a href="/docs/git-push"> push </a> </li> <li> <a href="/docs/git-remote"> remote </a> </li> <li> <a href="/docs/git-submodule"> submodule </a> </li> </ul> </div> <div class='column-middle'> <h3 class='inspection'>Inspection and Comparison</h3> <ul class='unstyled'> <li> <a href="/docs/git-show"> show </a> </li> <li> <a href="/docs/git-log"> log </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-difftool"> difftool </a> </li> <li> <a href="/docs/git-range-diff"> range-diff </a> </li> <li> <a href="/docs/git-shortlog"> shortlog </a> </li> <li> <a href="/docs/git-describe"> describe </a> </li> </ul> <h3 class='patching'>Patching</h3> <ul class='unstyled'> <li> <a href="/docs/git-apply"> apply </a> </li> <li> <a href="/docs/git-cherry-pick"> cherry-pick </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-rebase"> rebase </a> </li> <li> <a href="/docs/git-revert"> revert </a> </li> </ul> <h3 class='debugging'>Debugging</h3> <ul class='unstyled'> <li> <a href="/docs/git-bisect"> bisect </a> </li> <li> <a href="/docs/git-blame"> blame </a> </li> <li> <a href="/docs/git-grep"> grep </a> </li> </ul> <h3 class='email'>Email</h3> <ul class='unstyled'> <li> <a href="/docs/git-am"> am </a> </li> <li> <a href="/docs/git-apply"> apply </a> </li> <li> <a href="/docs/git-format-patch"> format-patch </a> </li> <li> <a href="/docs/git-send-email"> send-email </a> </li> <li> <a href="/docs/git-request-pull"> request-pull </a> </li> </ul> <h3 class='external'>External Systems</h3> <ul class='unstyled'> <li> <a href="/docs/git-svn"> svn </a> </li> <li> <a href="/docs/git-fast-import"> fast-import </a> </li> </ul> <h3 class='server-admin'>Server Admin</h3> <ul class='unstyled'> <li> <a href="/docs/git-daemon"> daemon </a> </li> <li> <a href="/docs/git-update-server-info"> update-server-info </a> </li> </ul> </div> <div class='column-right'> <h3 class='guides'>Guides</h3> <ul class='unstyled'> <li> <a href="/docs/gitattributes"> gitattributes </a> </li> <li> <a href="/docs/gitcli"> Command-line interface conventions </a> </li> <li> <a href="/docs/giteveryday"> Everyday Git </a> </li> <li> <a href="/docs/gitfaq"> Frequently Asked Questions (FAQ) </a> </li> <li> <a href="/docs/gitglossary"> Glossary </a> </li> <li> <a href="/docs/githooks"> Hooks </a> </li> <li> <a href="/docs/gitignore"> gitignore </a> </li> <li> <a href="/docs/gitmodules"> gitmodules </a> </li> <li> <a href="/docs/gitrevisions"> Revisions </a> </li> <li> <a href="/docs/gitsubmodules"> Submodules </a> </li> <li> <a href="/docs/gittutorial"> Tutorial </a> </li> <li> <a href="/docs/gitworkflows"> Workflows </a> </li> <li> <a href="/docs/git#_guides"> All guides... </a> </li> </ul> <h3 class='admin'>Administration</h3> <ul class='unstyled'> <li> <a href="/docs/git-clean"> clean </a> </li> <li> <a href="/docs/git-gc"> gc </a> </li> <li> <a href="/docs/git-fsck"> fsck </a> </li> <li> <a href="/docs/git-reflog"> reflog </a> </li> <li> <a href="/docs/git-filter-branch"> filter-branch </a> </li> <li> <a href="/docs/git-instaweb"> instaweb </a> </li> <li> <a href="/docs/git-archive"> archive </a> </li> <li> <a href="/docs/git-bundle"> bundle </a> </li> </ul> <h3 class='plumbing'>Plumbing Commands</h3> <ul class='unstyled'> <li> <a href="/docs/git-cat-file"> cat-file </a> </li> <li> <a href="/docs/git-check-ignore"> check-ignore </a> </li> <li> <a href="/docs/git-checkout-index"> checkout-index </a> </li> <li> <a href="/docs/git-commit-tree"> commit-tree </a> </li> <li> <a href="/docs/git-count-objects"> count-objects </a> </li> <li> <a href="/docs/git-diff-index"> diff-index </a> </li> <li> <a href="/docs/git-for-each-ref"> for-each-ref </a> </li> <li> <a href="/docs/git-hash-object"> hash-object </a> </li> <li> <a href="/docs/git-ls-files"> ls-files </a> </li> <li> <a href="/docs/git-ls-tree"> ls-tree </a> </li> <li> <a href="/docs/git-merge-base"> merge-base </a> </li> <li> <a href="/docs/git-read-tree"> read-tree </a> </li> <li> <a href="/docs/git-rev-list"> rev-list </a> </li> <li> <a href="/docs/git-rev-parse"> rev-parse </a> </li> <li> <a href="/docs/git-show-ref"> show-ref </a> </li> <li> <a href="/docs/git-symbolic-ref"> symbolic-ref </a> </li> <li> <a href="/docs/git-update-index"> update-index </a> </li> <li> <a href="/docs/git-update-ref"> update-ref </a> </li> <li> <a href="/docs/git-verify-pack"> verify-pack </a> </li> <li> <a href="/docs/git-write-tree"> write-tree </a> </li> </ul> </div> </div> </div> <a class="dropdown-trigger" id="reference-versions-trigger" data-panel-id="previous-versions-dropdown" href="#"> Latest version ▾ </a> <span class="light d-flex">gitmodules last updated in 2.42.0</span> <div class='dropdown-panel left' id='previous-versions-dropdown'> <header>Changes in the <strong>gitmodules</strong> manual</header> <ol class='reference-previous-versions'> <li class="no-change"><span>2.42.1 → 2.49.0 no changes</span></li> <li> <a href="/docs/gitmodules/2.42.0"><span class="version">2.42.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2023-08-21</em> </a> </li> <li class="no-change"><span>2.32.1 → 2.41.3 no changes</span></li> <li> <a href="/docs/gitmodules/2.32.0"><span class="version">2.32.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2021-06-06</em> </a> </li> <li class="no-change"><span>2.30.2 → 2.31.8 no changes</span></li> <li> <a href="/docs/gitmodules/2.30.1"><span class="version">2.30.1</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2021-02-08</em> </a> </li> <li class="no-change"><span>2.28.1 → 2.30.0 no changes</span></li> <li> <a href="/docs/gitmodules/2.28.0"><span class="version">2.28.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2020-07-27</em> </a> </li> <li class="no-change"><span>2.25.1 → 2.27.1 no changes</span></li> <li> <a href="/docs/gitmodules/2.25.0"><span class="version">2.25.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2020-01-13</em> </a> </li> <li class="no-change"><span>2.24.2 → 2.24.4 no changes</span></li> <li> <a href="/docs/gitmodules/2.24.1"><span class="version">2.24.1</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li> <a href="/docs/gitmodules/2.24.0"><span class="version">2.24.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-11-04</em> </a> </li> <li class="no-change"><span>2.23.2 → 2.23.4 no changes</span></li> <li> <a href="/docs/gitmodules/2.23.1"><span class="version">2.23.1</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li> <a href="/docs/gitmodules/2.23.0"><span class="version">2.23.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-08-16</em> </a> </li> <li class="no-change"><span>2.22.3 → 2.22.5 no changes</span></li> <li> <a href="/docs/gitmodules/2.22.2"><span class="version">2.22.2</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li class="no-change"><span>2.22.1 no changes</span></li> <li> <a href="/docs/gitmodules/2.22.0"><span class="version">2.22.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-06-07</em> </a> </li> <li class="no-change"><span>2.21.2 → 2.21.4 no changes</span></li> <li> <a href="/docs/gitmodules/2.21.1"><span class="version">2.21.1</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li> <a href="/docs/gitmodules/2.21.0"><span class="version">2.21.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-02-24</em> </a> </li> <li class="no-change"><span>2.20.3 → 2.20.5 no changes</span></li> <li> <a href="/docs/gitmodules/2.20.2"><span class="version">2.20.2</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li class="no-change"><span>2.20.1 no changes</span></li> <li> <a href="/docs/gitmodules/2.20.0"><span class="version">2.20.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-12-09</em> </a> </li> <li class="no-change"><span>2.19.4 → 2.19.6 no changes</span></li> <li> <a href="/docs/gitmodules/2.19.3"><span class="version">2.19.3</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li> <a href="/docs/gitmodules/2.19.2"><span class="version">2.19.2</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-11-21</em> </a> </li> <li class="no-change"><span>2.19.1 no changes</span></li> <li> <a href="/docs/gitmodules/2.19.0"><span class="version">2.19.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-09-10</em> </a> </li> <li class="no-change"><span>2.18.3 → 2.18.5 no changes</span></li> <li> <a href="/docs/gitmodules/2.18.2"><span class="version">2.18.2</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li class="no-change"><span>2.18.1 no changes</span></li> <li> <a href="/docs/gitmodules/2.18.0"><span class="version">2.18.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-06-21</em> </a> </li> <li class="no-change"><span>2.17.4 → 2.17.6 no changes</span></li> <li> <a href="/docs/gitmodules/2.17.3"><span class="version">2.17.3</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li class="no-change"><span>2.17.1 → 2.17.2 no changes</span></li> <li> <a href="/docs/gitmodules/2.17.0"><span class="version">2.17.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-04-02</em> </a> </li> <li class="no-change"><span>2.16.6 no changes</span></li> <li> <a href="/docs/gitmodules/2.15.4"><span class="version">2.15.4</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li class="no-change"><span>2.14.6 no changes</span></li> <li> <a href="/docs/gitmodules/2.13.7"><span class="version">2.13.7</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-05-22</em> </a> </li> <li class="no-change"><span>2.11.4 → 2.12.5 no changes</span></li> <li> <a href="/docs/gitmodules/2.10.5"><span class="version">2.10.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-09-22</em> </a> </li> <li> <a href="/docs/gitmodules/2.9.5"><span class="version">2.9.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-07-30</em> </a> </li> <li class="no-change"><span>2.4.12 → 2.8.6 no changes</span></li> <li> <a href="/docs/gitmodules/2.3.10"><span class="version">2.3.10</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2015-09-28</em> </a> </li> <li class="no-change"><span>2.1.4 → 2.2.3 no changes</span></li> <li> <a href="/docs/gitmodules/2.0.5"><span class="version">2.0.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2014-12-17</em> </a> </li> <li> </li> </ol> <footer> <p>Check your version of git by running</p> <code class="command">git --version</code> </footer> </div> </div> <div id="main" data-pagefind-filter="category:reference" data-pagefind-meta="category:Reference" data-pagefind-weight="0.05" data-pagefind-body> <div class="sect1"> <h2 id="_name"><a class="anchor" href="#_name"></a>NAME</h2> <div class="sectionbody"> <div class="paragraph"> <p>gitmodules - Defining submodule properties</p> </div> </div> </div> <div class="sect1"> <h2 id="_synopsis"><a class="anchor" href="#_synopsis"></a>SYNOPSIS</h2> <div class="sectionbody"> <div class="paragraph"> <p>$GIT_WORK_TREE/.gitmodules</p> </div> </div> </div> <div class="sect1"> <h2 id="_description"><a class="anchor" href="#_description"></a>DESCRIPTION</h2> <div class="sectionbody"> <div class="paragraph"> <p>The <code>.gitmodules</code> file, located in the top-level directory of a Git working tree, is a text file with a syntax matching the requirements of <a href='/docs/git-config'>git-config[1]</a>.</p> </div> <div class="paragraph"> <p>The file contains one subsection per submodule, and the subsection value is the name of the submodule. The name is set to the path where the submodule has been added unless it was customized with the <code>--name</code> option of <em>git submodule add</em>. Each submodule section also contains the following required keys:</p> </div> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegtpath"> <a class="anchor" href="#Documentation/gitmodules.txt-submoduleltnamegtpath"></a>submodule.<name>.path </dt> <dd> <p>Defines the path, relative to the top-level directory of the Git working tree, where the submodule is expected to be checked out. The path name must not end with a <code>/</code>. All submodule paths must be unique within the <code>.gitmodules</code> file.</p> </dd> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegturl"> <a class="anchor" href="#Documentation/gitmodules.txt-submoduleltnamegturl"></a>submodule.<name>.url </dt> <dd> <p>Defines a URL from which the submodule repository can be cloned. This may be either an absolute URL ready to be passed to <a href='/docs/git-clone'>git-clone[1]</a> or (if it begins with <code>./</code> or <code>../</code>) a location relative to the superproject’s origin repository.</p> </dd> </dl> </div> <div class="paragraph"> <p>In addition, there are a number of optional keys:</p> </div> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegtupdate"> <a class="anchor" href="#Documentation/gitmodules.txt-submoduleltnamegtupdate"></a>submodule.<name>.update </dt> <dd> <p>Defines the default update procedure for the named submodule, i.e. how the submodule is updated by the <code>git submodule update</code> command in the superproject. This is only used by <code>git submodule init</code> to initialize the configuration variable of the same name. Allowed values here are <em>checkout</em>, <em>rebase</em>, <em>merge</em> or <em>none</em>, but not <em>!command</em> (for security reasons). See the description of the <em>update</em> command in <a href='/docs/git-submodule'>git-submodule[1]</a> for more details.</p> </dd> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegtbranch"> <a class="anchor" href="#Documentation/gitmodules.txt-submoduleltnamegtbranch"></a>submodule.<name>.branch </dt> <dd> <p>A remote branch name for tracking updates in the upstream submodule. If the option is not specified, it defaults to the remote <code>HEAD</code>. A special value of <code>.</code> is used to indicate that the name of the branch in the submodule should be the same name as the current branch in the current repository. See the <code>--remote</code> documentation in <a href='/docs/git-submodule'>git-submodule[1]</a> for details.</p> </dd> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegtfetchRecurseSubmodules"> <a class="anchor" href="#Documentation/gitmodules.txt-submoduleltnamegtfetchRecurseSubmodules"></a>submodule.<name>.fetchRecurseSubmodules </dt> <dd> <p>This option can be used to control recursive fetching of this submodule. If this option is also present in the submodule’s entry in <code>.git/config</code> of the superproject, the setting there will override the one found in <code>.gitmodules</code>. Both settings can be overridden on the command line by using the <code>--[no-]recurse-submodules</code> option to <code>git fetch</code> and <code>git pull</code>.</p> </dd> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegtignore"> <a class="anchor" href="#Documentation/gitmodules.txt-submoduleltnamegtignore"></a>submodule.<name>.ignore </dt> <dd> <p>Defines under what circumstances <code>git status</code> and the diff family show a submodule as modified. The following values are supported:</p> <div class="openblock"> <div class="content"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/gitmodules.txt-all"> <a class="anchor" href="#Documentation/gitmodules.txt-all"></a>all </dt> <dd> <p>The submodule will never be considered modified (but will nonetheless show up in the output of status and commit when it has been staged).</p> </dd> <dt class="hdlist1" id="Documentation/gitmodules.txt-dirty"> <a class="anchor" href="#Documentation/gitmodules.txt-dirty"></a>dirty </dt> <dd> <p>All changes to the submodule’s work tree will be ignored, only committed differences between the <code>HEAD</code> of the submodule and its recorded state in the superproject are taken into account.</p> </dd> <dt class="hdlist1" id="Documentation/gitmodules.txt-untracked"> <a class="anchor" href="#Documentation/gitmodules.txt-untracked"></a>untracked </dt> <dd> <p>Only untracked files in submodules will be ignored. Committed differences and modifications to tracked files will show up.</p> </dd> <dt class="hdlist1" id="Documentation/gitmodules.txt-none"> <a class="anchor" href="#Documentation/gitmodules.txt-none"></a>none </dt> <dd> <p>No modifications to submodules are ignored, all of committed differences, and modifications to tracked and untracked files are shown. This is the default option.</p> </dd> </dl> </div> <div class="paragraph"> <p>If this option is also present in the submodule’s entry in <code>.git/config</code> of the superproject, the setting there will override the one found in <code>.gitmodules</code>.</p> </div> <div class="paragraph"> <p>Both settings can be overridden on the command line by using the <code>--ignore-submodules</code> option. The <code>git submodule</code> commands are not affected by this setting.</p> </div> </div> </div> </dd> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegtshallow"> <a class="anchor" href="#Documentation/gitmodules.txt-submoduleltnamegtshallow"></a>submodule.<name>.shallow </dt> <dd> <p>When set to true, a clone of this submodule will be performed as a shallow clone (with a history depth of 1) unless the user explicitly asks for a non-shallow clone.</p> </dd> </dl> </div> </div> </div> <div class="sect1"> <h2 id="_notes"><a class="anchor" href="#_notes"></a>NOTES</h2> <div class="sectionbody"> <div class="paragraph"> <p>Git does not allow the <code>.gitmodules</code> file within a working tree to be a symbolic link, and will refuse to check out such a tree entry. This keeps behavior consistent when the file is accessed from the index or a tree versus from the filesystem, and helps Git reliably enforce security checks of the file contents.</p> </div> </div> </div> <div class="sect1"> <h2 id="_examples"><a class="anchor" href="#_examples"></a>EXAMPLES</h2> <div class="sectionbody"> <div class="paragraph"> <p>Consider the following <code>.gitmodules</code> file:</p> </div> <div class="listingblock"> <div class="content"> <pre>[submodule "libfoo"] path = include/foo url = git://foo.com/git/lib.git [submodule "libbar"] path = include/bar url = git://bar.com/git/lib.git</pre> </div> </div> <div class="paragraph"> <p>This defines two submodules, <code>libfoo</code> and <code>libbar</code>. These are expected to be checked out in the paths <code>include/foo</code> and <code>include/bar</code>, and for both submodules a URL is specified which can be used for cloning the submodules.</p> </div> </div> </div> <div class="sect1"> <h2 id="_see_also"><a class="anchor" href="#_see_also"></a>SEE ALSO</h2> <div class="sectionbody"> <div class="paragraph"> <p><a href='/docs/git-submodule'>git-submodule[1]</a>, <a href='/docs/gitsubmodules'>gitsubmodules[7]</a>, <a href='/docs/git-config'>git-config[1]</a></p> </div> </div> </div> <div class="sect1"> <h2 id="_git"><a class="anchor" href="#_git"></a>GIT</h2> <div class="sectionbody"> <div class="paragraph"> <p>Part of the <a href='/docs/git'>git[1]</a> suite</p> </div> </div> </div> <h3 hidden="true" data-pagefind-weight="10">gitmodules</h3> </div> </div> </div> <footer> <div class="site-source"> <a href="/site">About this site</a><br> Patches, suggestions, and comments are welcome. </div> <div class="sfc-member"> Git is a member of <a href="/sfc">Software Freedom Conservancy</a> </div> </footer> <a href="#top" class="no-js scrollToTop" id="scrollToTop" data-label="Scroll to top"> <img src="/images/icons/chevron-up@2x.png" width="20" height="20" alt="scroll-to-top"/> </a> <script src="/js/jquery-1.7.1.min.js"></script> <script src="/js/jquery-ui-1.8.18.custom.min.js"></script> <script src="/js/jquery.defaultvalue.js"></script> <script src="/js/session.min.js"></script> <script src="/js/modernizr.js"></script> <script src="/js/modernize.js"></script> <script src="/js/application.min.js"></script> </div> </body> </html>