blob: e818e6e7895a94af0b05f04d2c8ecdae64583efd [file] [log] [blame]
Junio C Hamano38b693c2007-06-03 08:40:141git-submodule(1)
2================
3
4NAME
5----
6git-submodule - Initialize, update or inspect submodules
7
8
9SYNOPSIS
10--------
Junio C Hamano7a4a2832007-07-07 21:53:2211[verse]
Junio C Hamano42059e72008-01-22 08:39:1412'git-submodule' [--quiet] add [-b branch] [--] <repository> [<path>]
13'git-submodule' [--quiet] status [--cached] [--] [<path>...]
14'git-submodule' [--quiet] [init|update] [--] [<path>...]
Junio C Hamano38b693c2007-06-03 08:40:1415
16
17COMMANDS
18--------
Junio C Hamano1d90cb02007-07-03 07:05:3119add::
20Add the given repository as a submodule at the given path
21to the changeset to be committed next. In particular, the
22repository is cloned at the specified path, added to the
23changeset and registered in .gitmodules. If no path is
24specified, the path is deduced from the repository specification.
Junio C Hamano4fd58d42007-09-30 00:51:1425If the repository url begins with ./ or ../, it is stored as
26given but resolved as a relative path from the main project's
27url when cloning.
Junio C Hamano1d90cb02007-07-03 07:05:3128
Junio C Hamano38b693c2007-06-03 08:40:1429status::
30Show the status of the submodules. This will print the SHA-1 of the
31currently checked out commit for each submodule, along with the
Junio C Hamano35738e82008-01-07 07:55:4632submodule path and the output of linkgit:git-describe[1] for the
Junio C Hamano38b693c2007-06-03 08:40:1433SHA-1. Each SHA-1 will be prefixed with `-` if the submodule is not
34initialized and `+` if the currently checked out submodule commit
35does not match the SHA-1 found in the index of the containing
36repository. This command is the default command for git-submodule.
37
38init::
Junio C Hamano16f98872007-06-12 16:09:1439Initialize the submodules, i.e. register in .git/config each submodule
Junio C Hamano7a4a2832007-07-07 21:53:2240name and url found in .gitmodules. The key used in .git/config is
41`submodule.$name.url`. This command does not alter existing information
Junio C Hamano16f98872007-06-12 16:09:1442in .git/config.
Junio C Hamano38b693c2007-06-03 08:40:1443
44update::
Junio C Hamano16f98872007-06-12 16:09:1445Update the registered submodules, i.e. clone missing submodules and
46checkout the commit specified in the index of the containing repository.
47This will make the submodules HEAD be detached.
Junio C Hamano38b693c2007-06-03 08:40:1448
49
50OPTIONS
51-------
52-q, --quiet::
53Only print error messages.
54
Junio C Hamano1d90cb02007-07-03 07:05:3155-b, --branch::
56Branch of repository to add as submodule.
57
Junio C Hamano38b693c2007-06-03 08:40:1458--cached::
59Display the SHA-1 stored in the index, not the SHA-1 of the currently
60checked out submodule commit. This option is only valid for the
61status command.
62
63<path>::
64Path to submodule(s). When specified this will restrict the command
65to only operate on the submodules found at the specified paths.
66
67FILES
68-----
Junio C Hamano16f98872007-06-12 16:09:1469When initializing submodules, a .gitmodules file in the top-level directory
Junio C Hamano38b693c2007-06-03 08:40:1470of the containing repository is used to find the url of each submodule.
Junio C Hamano91baf102007-12-31 09:44:2671This file should be formatted in the same way as `$GIT_DIR/config`. The key
Junio C Hamano35738e82008-01-07 07:55:4672to each submodule url is "submodule.$name.url". See linkgit:gitmodules[5]
Junio C Hamanoe66c6c02007-12-17 08:26:1373for details.
Junio C Hamano38b693c2007-06-03 08:40:1474
75
76AUTHOR
77------
78Written by Lars Hjemli <hjemli@gmail.com>
79
80GIT
81---
Junio C Hamano35738e82008-01-07 07:55:4682Part of the linkgit:git[7] suite