blob: 8ae107da250ff01b17b5215a474c781a0f0ae57a [file] [log] [blame]
Junio C Hamano6926bef2007-06-16 09:54:051gitmodules(5)
2=============
3
4NAME
5----
6gitmodules - defining submodule properties
7
8SYNOPSIS
9--------
Junio C Hamano17bd2272008-09-01 06:11:1710$GIT_WORK_DIR/.gitmodules
Junio C Hamano6926bef2007-06-16 09:54:0511
12
13DESCRIPTION
14-----------
15
16The `.gitmodules` file, located in the top-level directory of a git
17working tree, is a text file with a syntax matching the requirements
Junio C Hamano35738e82008-01-07 07:55:4618of linkgit:git-config[1].
Junio C Hamano6926bef2007-06-16 09:54:0519
20The file contains one subsection per submodule, and the subsection value
21is the name of the submodule. Each submodule section also contains the
22following required keys:
23
24submodule.<name>.path::
25Defines the path, relative to the top-level directory of the git
26working tree, where the submodule is expected to be checked out.
27The path name must not end with a `/`. All submodule paths must
28be unique within the .gitmodules file.
29
30submodule.<name>.url::
31Defines an url from where the submodule repository can be cloned.
Junio C Hamano78e3a782010-07-15 22:24:4532This may be either an absolute URL ready to be passed to
33linkgit:git-clone[1] or (if it begins with ./ or ../) a location
34relative to the superproject's origin repository.
Junio C Hamano6926bef2007-06-16 09:54:0535
Junio C Hamano25e7ba62009-06-14 01:03:2236submodule.<name>.update::
37Defines what to do when the submodule is updated by the superproject.
38If 'checkout' (the default), the new commit specified in the
39superproject will be checked out in the submodule on a detached HEAD.
40If 'rebase', the current branch of the submodule will be rebased onto
Junio C Hamano0e88f3e2009-06-21 08:03:2541the commit specified in the superproject. If 'merge', the commit
42specified in the superproject will be merged into the current branch
43in the submodule.
Junio C Hamano25e7ba62009-06-14 01:03:2244This config option is overridden if 'git submodule update' is given
Junio C Hamano0e88f3e2009-06-21 08:03:2545the '--merge' or '--rebase' options.
Junio C Hamano25e7ba62009-06-14 01:03:2246
Junio C Hamano619596a2010-08-18 22:15:3547submodule.<name>.ignore::
48Defines under what circumstances "git status" and the diff family show
49a submodule as modified. When set to "all", it will never be considered
50modified, "dirty" will ignore all changes to the submodules work tree and
51takes only differences between the HEAD of the submodule and the commit
52recorded in the superproject into account. "untracked" will additionally
53let submodules with modified tracked files in their work tree show up.
54Using "none" (the default when this option is not set) also shows
55submodules that have untracked files in their work tree as changed.
56If this option is also present in the submodules entry in .git/config of
57the superproject, the setting there will override the one found in
58.gitmodules.
59Both settings can be overriden on the command line by using the
60"--ignore-submodule" option.
61
Junio C Hamano6926bef2007-06-16 09:54:0562
63EXAMPLES
64--------
65
66Consider the following .gitmodules file:
67
68[submodule "libfoo"]
69path = include/foo
70url = git://foo.com/git/lib.git
71
72[submodule "libbar"]
73path = include/bar
74url = git://bar.com/git/lib.git
75
76
77This defines two submodules, `libfoo` and `libbar`. These are expected to
78be checked out in the paths 'include/foo' and 'include/bar', and for both
79submodules an url is specified which can be used for cloning the submodules.
80
81SEE ALSO
82--------
Junio C Hamano35738e82008-01-07 07:55:4683linkgit:git-submodule[1] linkgit:git-config[1]
Junio C Hamano6926bef2007-06-16 09:54:0584
85DOCUMENTATION
86-------------
87Documentation by Lars Hjemli <hjemli@gmail.com>
88
89GIT
90---
Junio C Hamanof7c042d2008-06-06 22:50:5391Part of the linkgit:git[1] suite