]>
Commit | Line | Data |
---|---|---|
891dbc6e LH |
1 | gitmodules(5) |
2 | ============= | |
3 | ||
4 | NAME | |
5 | ---- | |
6 | gitmodules - defining submodule properties | |
7 | ||
8 | SYNOPSIS | |
9 | -------- | |
e5b5c1d2 | 10 | $GIT_WORK_DIR/.gitmodules |
891dbc6e LH |
11 | |
12 | ||
13 | DESCRIPTION | |
14 | ----------- | |
15 | ||
16 | The `.gitmodules` file, located in the top-level directory of a git | |
17 | working tree, is a text file with a syntax matching the requirements | |
5162e697 | 18 | of linkgit:git-config[1]. |
891dbc6e LH |
19 | |
20 | The file contains one subsection per submodule, and the subsection value | |
21 | is the name of the submodule. Each submodule section also contains the | |
22 | following required keys: | |
23 | ||
24 | submodule.<name>.path:: | |
25 | Defines the path, relative to the top-level directory of the git | |
26 | working tree, where the submodule is expected to be checked out. | |
27 | The path name must not end with a `/`. All submodule paths must | |
28 | be unique within the .gitmodules file. | |
29 | ||
30 | submodule.<name>.url:: | |
31 | Defines an url from where the submodule repository can be cloned. | |
47dc5d5f JN |
32 | This may be either an absolute URL ready to be passed to |
33 | linkgit:git-clone[1] or (if it begins with ./ or ../) a location | |
34 | relative to the superproject's origin repository. | |
891dbc6e | 35 | |
32948425 JH |
36 | submodule.<name>.update:: |
37 | Defines what to do when the submodule is updated by the superproject. | |
38 | If 'checkout' (the default), the new commit specified in the | |
39 | superproject will be checked out in the submodule on a detached HEAD. | |
40 | If 'rebase', the current branch of the submodule will be rebased onto | |
42b49178 JH |
41 | the commit specified in the superproject. If 'merge', the commit |
42 | specified in the superproject will be merged into the current branch | |
43 | in the submodule. | |
32948425 | 44 | This config option is overridden if 'git submodule update' is given |
42b49178 | 45 | the '--merge' or '--rebase' options. |
ca2cedba | 46 | |
891dbc6e LH |
47 | |
48 | EXAMPLES | |
49 | -------- | |
50 | ||
51 | Consider the following .gitmodules file: | |
52 | ||
53 | [submodule "libfoo"] | |
54 | path = include/foo | |
55 | url = git://foo.com/git/lib.git | |
56 | ||
57 | [submodule "libbar"] | |
58 | path = include/bar | |
59 | url = git://bar.com/git/lib.git | |
60 | ||
61 | ||
62 | This defines two submodules, `libfoo` and `libbar`. These are expected to | |
63 | be checked out in the paths 'include/foo' and 'include/bar', and for both | |
64 | submodules an url is specified which can be used for cloning the submodules. | |
65 | ||
66 | SEE ALSO | |
67 | -------- | |
5162e697 | 68 | linkgit:git-submodule[1] linkgit:git-config[1] |
891dbc6e LH |
69 | |
70 | DOCUMENTATION | |
71 | ------------- | |
72 | Documentation by Lars Hjemli <hjemli@gmail.com> | |
73 | ||
74 | GIT | |
75 | --- | |
9e1f0a85 | 76 | Part of the linkgit:git[1] suite |