]>
Commit | Line | Data |
---|---|---|
70c7ac22 LH |
1 | git-submodule(1) |
2 | ================ | |
3 | ||
4 | NAME | |
5 | ---- | |
6 | git-submodule - Initialize, update or inspect submodules | |
7 | ||
8 | ||
9 | SYNOPSIS | |
10 | -------- | |
b2493649 | 11 | [verse] |
ecda0723 | 12 | 'git-submodule' [--quiet] [-b branch] add <repository> [<path>] |
70c7ac22 LH |
13 | 'git-submodule' [--quiet] [--cached] [status|init|update] [--] [<path>...] |
14 | ||
15 | ||
16 | COMMANDS | |
17 | -------- | |
ecda0723 SV |
18 | add:: |
19 | Add the given repository as a submodule at the given path | |
20 | to the changeset to be committed next. In particular, the | |
21 | repository is cloned at the specified path, added to the | |
22 | changeset and registered in .gitmodules. If no path is | |
23 | specified, the path is deduced from the repository specification. | |
f31a522a ML |
24 | If the repository url begins with ./ or ../, it is stored as |
25 | given but resolved as a relative path from the main project's | |
26 | url when cloning. | |
ecda0723 | 27 | |
70c7ac22 LH |
28 | status:: |
29 | Show the status of the submodules. This will print the SHA-1 of the | |
30 | currently checked out commit for each submodule, along with the | |
31 | submodule path and the output of gitlink:git-describe[1] for the | |
32 | SHA-1. Each SHA-1 will be prefixed with `-` if the submodule is not | |
33 | initialized and `+` if the currently checked out submodule commit | |
34 | does not match the SHA-1 found in the index of the containing | |
35 | repository. This command is the default command for git-submodule. | |
36 | ||
37 | init:: | |
211b7f19 | 38 | Initialize the submodules, i.e. register in .git/config each submodule |
813a0bd8 LH |
39 | name and url found in .gitmodules. The key used in .git/config is |
40 | `submodule.$name.url`. This command does not alter existing information | |
211b7f19 | 41 | in .git/config. |
70c7ac22 LH |
42 | |
43 | update:: | |
211b7f19 LH |
44 | Update the registered submodules, i.e. clone missing submodules and |
45 | checkout the commit specified in the index of the containing repository. | |
46 | This will make the submodules HEAD be detached. | |
70c7ac22 LH |
47 | |
48 | ||
49 | OPTIONS | |
50 | ------- | |
51 | -q, --quiet:: | |
52 | Only print error messages. | |
53 | ||
ecda0723 SV |
54 | -b, --branch:: |
55 | Branch of repository to add as submodule. | |
56 | ||
70c7ac22 LH |
57 | --cached:: |
58 | Display the SHA-1 stored in the index, not the SHA-1 of the currently | |
59 | checked out submodule commit. This option is only valid for the | |
60 | status command. | |
61 | ||
62 | <path>:: | |
63 | Path to submodule(s). When specified this will restrict the command | |
64 | to only operate on the submodules found at the specified paths. | |
65 | ||
66 | FILES | |
67 | ----- | |
211b7f19 | 68 | When initializing submodules, a .gitmodules file in the top-level directory |
70c7ac22 LH |
69 | of the containing repository is used to find the url of each submodule. |
70 | This file should be formatted in the same way as $GIR_DIR/config. The key | |
813a0bd8 | 71 | to each submodule url is "submodule.$name.url". |
70c7ac22 LH |
72 | |
73 | ||
74 | AUTHOR | |
75 | ------ | |
76 | Written by Lars Hjemli <hjemli@gmail.com> | |
77 | ||
78 | GIT | |
79 | --- | |
80 | Part of the gitlink:git[7] suite |