diff options
Diffstat (limited to 'devdocs/git/gitmodules.html')
| -rw-r--r-- | devdocs/git/gitmodules.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/devdocs/git/gitmodules.html b/devdocs/git/gitmodules.html new file mode 100644 index 00000000..e2fddc05 --- /dev/null +++ b/devdocs/git/gitmodules.html @@ -0,0 +1,13 @@ +<h1>gitmodules</h1> <h2 id="_name">Name</h2> <div class="sectionbody"> <p>gitmodules - Defining submodule properties</p> </div> <h2 id="_synopsis">Synopsis</h2> <div class="sectionbody"> <p>$GIT_WORK_TREE/.gitmodules</p> </div> <h2 id="_description">Description</h2> <div class="sectionbody"> <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="git-config">git-config[1]</a>.</p> <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 <code>git submodule add</code>. Each submodule section also contains the following required keys:</p> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegtpath"> 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"> 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="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> <p>In addition, there are a number of optional keys:</p> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegtupdate"> 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 <code>checkout</code>, <code>rebase</code>, <code>merge</code> or <code>none</code>, but not <code>!command</code> (for security reasons). See the description of the <code>update</code> command in <a href="git-submodule">git-submodule[1]</a> for more details.</p> </dd> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegtbranch"> 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="git-submodule">git-submodule[1]</a> for details.</p> </dd> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegtfetchRecurseSubmodules"> 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"> 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"> 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"> 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"> 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"> 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> <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> <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> </dd> <dt class="hdlist1" id="Documentation/gitmodules.txt-submoduleltnamegtshallow"> 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> <h2 id="_notes">Notes</h2> <div class="sectionbody"> <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> <h2 id="_examples">Examples</h2> <div class="sectionbody"> <p>Consider the following <code>.gitmodules</code> file:</p> <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> <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> <h2 id="_see_also">See also</h2> <div class="sectionbody"> <p><a href="git-submodule">git-submodule[1]</a>, <a href="gitsubmodules">gitsubmodules[7]</a>, <a href="git-config">git-config[1]</a></p> </div><div class="_attribution"> + <p class="_attribution-p"> + © 2012–2024 Scott Chacon and others<br>Licensed under the MIT License.<br> + <a href="https://git-scm.com/docs/gitmodules" class="_attribution-link">https://git-scm.com/docs/gitmodules</a> + </p> +</div> |
