3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.42.0.176.gd6c51973e4
10 .TH "GITMODULES" "5" "2023\-09\-13" "Git 2\&.42\&.0\&.176\&.gd6c519" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 gitmodules \- Defining submodule properties
34 $GIT_WORK_TREE/\&.gitmodules
37 The \fB\&.gitmodules\fR file, located in the top\-level directory of a Git working tree, is a text file with a syntax matching the requirements of \fBgit-config\fR(1)\&.
39 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 \fB\-\-name\fR option of \fIgit submodule add\fR\&. Each submodule section also contains the following required keys:
41 submodule\&.<name>\&.path
43 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
44 \fB/\fR\&. All submodule paths must be unique within the
49 submodule\&.<name>\&.url
51 Defines a URL from which the submodule repository can be cloned\&. This may be either an absolute URL ready to be passed to
56 \fB\&.\&./\fR) a location relative to the superproject\(cqs origin repository\&.
59 In addition, there are a number of optional keys:
61 submodule\&.<name>\&.update
63 Defines the default update procedure for the named submodule, i\&.e\&. how the submodule is updated by the
64 \fBgit submodule update\fR
65 command in the superproject\&. This is only used by
66 \fBgit submodule init\fR
67 to initialize the configuration variable of the same name\&. Allowed values here are
74 (for security reasons)\&. See the description of the
77 \fBgit-submodule\fR(1)
81 submodule\&.<name>\&.branch
83 A remote branch name for tracking updates in the upstream submodule\&. If the option is not specified, it defaults to the remote
84 \fBHEAD\fR\&. A special value of
86 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
89 \fBgit-submodule\fR(1)
93 submodule\&.<name>\&.fetchRecurseSubmodules
95 This option can be used to control recursive fetching of this submodule\&. If this option is also present in the submodule\(cqs entry in
97 of the superproject, the setting there will override the one found in
98 \fB\&.gitmodules\fR\&. Both settings can be overridden on the command line by using the
99 \fB\-\-[no\-]recurse\-submodules\fR
106 submodule\&.<name>\&.ignore
108 Defines under what circumstances
110 and the diff family show a submodule as modified\&. The following values are supported:
114 The submodule will never be considered modified (but will nonetheless show up in the output of status and commit when it has been staged)\&.
119 All changes to the submodule\(cqs work tree will be ignored, only committed differences between the
121 of the submodule and its recorded state in the superproject are taken into account\&.
126 Only untracked files in submodules will be ignored\&. Committed differences and modifications to tracked files will show up\&.
131 No modifications to submodules are ignored, all of committed differences, and modifications to tracked and untracked files are shown\&. This is the default option\&.
134 If this option is also present in the submodule\(cqs entry in
136 of the superproject, the setting there will override the one found in
137 \fB\&.gitmodules\fR\&.
139 Both settings can be overridden on the command line by using the
140 \fB\-\-ignore\-submodules\fR
143 commands are not affected by this setting\&.
146 submodule\&.<name>\&.shallow
148 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\&.
152 Git does not allow the \fB\&.gitmodules\fR 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\&.
155 Consider the following \fB\&.gitmodules\fR file:
163 url = git://foo\&.com/git/lib\&.git
167 url = git://bar\&.com/git/lib\&.git
174 This defines two submodules, \fBlibfoo\fR and \fBlibbar\fR\&. These are expected to be checked out in the paths \fBinclude/foo\fR and \fBinclude/bar\fR, and for both submodules a URL is specified which can be used for cloning the submodules\&.
177 \fBgit-submodule\fR(1), \fBgitsubmodules\fR(7), \fBgit-config\fR(1)
180 Part of the \fBgit\fR(1) suite