updated git doc
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / gitmodules.xml
blob7f591e91ac22563d7683d865c28e18b3d986fe8d
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <article lang="en" id="gitmodules(5)">\r
5 <articleinfo>\r
6     <title>gitmodules(5)</title>\r
7 <indexterm>\r
8 <primary>gitmodules(5)</primary>\r
9 </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>gitmodules - defining submodule properties</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <simpara>$GIT_WORK_DIR/.gitmodules</simpara>\r
18 </simplesect>\r
19 <simplesect id="_description">\r
20 <title>DESCRIPTION</title>\r
21 <simpara>The <emphasis>.gitmodules</emphasis> file, located in the top-level directory of a git\r
22 working tree, is a text file with a syntax matching the requirements\r
23 of <xref linkend="git-config(1)" />.</simpara>\r
24 <simpara>The file contains one subsection per submodule, and the subsection value\r
25 is the name of the submodule. Each submodule section also contains the\r
26 following required keys:</simpara>\r
27 <variablelist>\r
28 <varlistentry>\r
29 <term>\r
30 submodule.&lt;name&gt;.path\r
31 </term>\r
32 <listitem>\r
33 <simpara>\r
34         Defines the path, relative to the top-level directory of the git\r
35         working tree, where the submodule is expected to be checked out.\r
36         The path name must not end with a <emphasis>/</emphasis>. All submodule paths must\r
37         be unique within the .gitmodules file.\r
38 </simpara>\r
39 </listitem>\r
40 </varlistentry>\r
41 <varlistentry>\r
42 <term>\r
43 submodule.&lt;name&gt;.url\r
44 </term>\r
45 <listitem>\r
46 <simpara>\r
47         Defines a URL from which the submodule repository can be cloned.\r
48         This may be either an absolute URL ready to be passed to\r
49         <xref linkend="git-clone(1)" /> or (if it begins with ./ or ../) a location\r
50         relative to the superproject's origin repository.\r
51 </simpara>\r
52 </listitem>\r
53 </varlistentry>\r
54 <varlistentry>\r
55 <term>\r
56 submodule.&lt;name&gt;.update\r
57 </term>\r
58 <listitem>\r
59 <simpara>\r
60         Defines what to do when the submodule is updated by the superproject.\r
61         If <emphasis>checkout</emphasis> (the default), the new commit specified in the\r
62         superproject will be checked out in the submodule on a detached HEAD.\r
63         If <emphasis>rebase</emphasis>, the current branch of the submodule will be rebased onto\r
64         the commit specified in the superproject. If <emphasis>merge</emphasis>, the commit\r
65         specified in the superproject will be merged into the current branch\r
66         in the submodule.\r
67         If <emphasis>none</emphasis>, the submodule with name <emphasis>$name</emphasis> will not be updated\r
68         by default.\r
69 </simpara>\r
70 <literallayout class="monospaced">This config option is overridden if 'git submodule update' is given\r
71 the '--merge', '--rebase' or '--checkout' options.</literallayout>\r
72 </listitem>\r
73 </varlistentry>\r
74 <varlistentry>\r
75 <term>\r
76 submodule.&lt;name&gt;.fetchRecurseSubmodules\r
77 </term>\r
78 <listitem>\r
79 <simpara>\r
80         This option can be used to control recursive fetching of this\r
81         submodule. If this option is also present in the submodules entry in\r
82         .git/config of the superproject, the setting there will override the\r
83         one found in .gitmodules.\r
84         Both settings can be overridden on the command line by using the\r
85         "--[no-]recurse-submodules" option to "git fetch" and "git pull".\r
86 </simpara>\r
87 </listitem>\r
88 </varlistentry>\r
89 <varlistentry>\r
90 <term>\r
91 submodule.&lt;name&gt;.ignore\r
92 </term>\r
93 <listitem>\r
94 <simpara>\r
95         Defines under what circumstances "git status" and the diff family show\r
96         a submodule as modified. When set to "all", it will never be considered\r
97         modified, "dirty" will ignore all changes to the submodules work tree and\r
98         takes only differences between the HEAD of the submodule and the commit\r
99         recorded in the superproject into account. "untracked" will additionally\r
100         let submodules with modified tracked files in their work tree show up.\r
101         Using "none" (the default when this option is not set) also shows\r
102         submodules that have untracked files in their work tree as changed.\r
103         If this option is also present in the submodules entry in .git/config of\r
104         the superproject, the setting there will override the one found in\r
105         .gitmodules.\r
106         Both settings can be overridden on the command line by using the\r
107         "--ignore-submodule" option.\r
108 </simpara>\r
109 </listitem>\r
110 </varlistentry>\r
111 </variablelist>\r
112 </simplesect>\r
113 <simplesect id="_examples">\r
114 <title>EXAMPLES</title>\r
115 <simpara>Consider the following .gitmodules file:</simpara>\r
116 <literallayout class="monospaced">[submodule "libfoo"]\r
117         path = include/foo\r
118         url = git://foo.com/git/lib.git</literallayout>\r
119 <literallayout class="monospaced">[submodule "libbar"]\r
120         path = include/bar\r
121         url = git://bar.com/git/lib.git</literallayout>\r
122 <simpara>This defines two submodules, <emphasis>libfoo</emphasis> and <emphasis>libbar</emphasis>. These are expected to\r
123 be checked out in the paths <emphasis>include/foo</emphasis> and <emphasis>include/bar</emphasis>, and for both\r
124 submodules a URL is specified which can be used for cloning the submodules.</simpara>\r
125 </simplesect>\r
126 <simplesect id="_see_also">\r
127 <title>SEE ALSO</title>\r
128 <simpara><xref linkend="git-submodule(1)" /> <xref linkend="git-config(1)" /></simpara>\r
129 </simplesect>\r
130 <simplesect id="_git">\r
131 <title>GIT</title>\r
132 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
133 </simplesect>\r
134 </article>\r