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