<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<article lang="en" id="gitmodules(5)">
<articleinfo>
    <title>gitmodules(5)</title>
        <indexterm>
                <primary>gitmodules(5)</primary>
        </indexterm>
</articleinfo>
<simplesect id="_name">
<title>NAME</title>
<simpara>gitmodules - defining submodule properties</simpara>
</simplesect>
<simplesect id="_synopsis">
<title>SYNOPSIS</title>
<simpara>$GIT_WORK_DIR/.gitmodules</simpara>
</simplesect>
<simplesect id="_description">
<title>DESCRIPTION</title>
<simpara>The <literal>.gitmodules</literal> file, located in the top-level directory of a git
working tree, is a text file with a syntax matching the requirements
of <xref linkend="git-config(1)"/>.</simpara>
<simpara>The file contains one subsection per submodule, and the subsection value
is the name of the submodule. Each submodule section also contains the
following required keys:</simpara>
<variablelist>
<varlistentry>
<term>
submodule.&lt;name&gt;.path
</term>
<listitem>
<simpara>
        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 <literal>/</literal>. All submodule paths must
        be unique within the .gitmodules file.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
submodule.&lt;name&gt;.url
</term>
<listitem>
<simpara>
        Defines an url from where the submodule repository can be cloned.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="_examples">
<title>EXAMPLES</title>
<simpara>Consider the following .gitmodules file:</simpara>
<literallayout class="monospaced">[submodule "libfoo"]
        path = include/foo
        url = git://foo.com/git/lib.git</literallayout>
<literallayout class="monospaced">[submodule "libbar"]
        path = include/bar
        url = git://bar.com/git/lib.git</literallayout>
<simpara>This defines two submodules, <literal>libfoo</literal> and <literal>libbar</literal>. These are expected to
be checked out in the paths <emphasis>include/foo</emphasis> and <emphasis>include/bar</emphasis>, and for both
submodules an url is specified which can be used for cloning the submodules.</simpara>
</simplesect>
<simplesect id="_see_also">
<title>SEE ALSO</title>
<simpara><xref linkend="git-submodule(1)"/> <xref linkend="git-config(1)"/></simpara>
</simplesect>
<simplesect id="_documentation">
<title>DOCUMENTATION</title>
<simpara>Documentation by Lars Hjemli &lt;<ulink url="mailto:hjemli@gmail.com">hjemli@gmail.com</ulink>&gt;</simpara>
</simplesect>
<simplesect id="_git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
</simplesect>
</article>
