blob: 9c4052c58af776feb8a0702596d40d448e640406 [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 Hamanofce7c7e2008-07-02 03:06:3812'git submodule' [--quiet] add [-b branch] [--] <repository> [<path>]
13'git submodule' [--quiet] status [--cached] [--] [<path>...]
14'git submodule' [--quiet] init [--] [<path>...]
15'git submodule' [--quiet] update [--init] [--] [<path>...]
16'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]
Junio C Hamano38b693c2007-06-03 08:40:1417
18
19COMMANDS
20--------
Junio C Hamano1d90cb02007-07-03 07:05:3121add::
22Add the given repository as a submodule at the given path
Junio C Hamanobb343172008-03-09 10:39:0923to the changeset to be committed next. If path is a valid
24repository within the project, it is added as is. Otherwise,
25repository is cloned at the specified path. path is added to the
Junio C Hamano1d90cb02007-07-03 07:05:3126changeset and registered in .gitmodules. If no path is
27specified, the path is deduced from the repository specification.
Junio C Hamano4fd58d42007-09-30 00:51:1428If the repository url begins with ./ or ../, it is stored as
29given but resolved as a relative path from the main project's
30url when cloning.
Junio C Hamano1d90cb02007-07-03 07:05:3131
Junio C Hamano38b693c2007-06-03 08:40:1432status::
33Show the status of the submodules. This will print the SHA-1 of the
34currently checked out commit for each submodule, along with the
Junio C Hamanofce7c7e2008-07-02 03:06:3835submodule path and the output of `git-describe` for the
Junio C Hamano38b693c2007-06-03 08:40:1436SHA-1. Each SHA-1 will be prefixed with `-` if the submodule is not
37initialized and `+` if the currently checked out submodule commit
38does not match the SHA-1 found in the index of the containing
Junio C Hamanofce7c7e2008-07-02 03:06:3839repository. This command is the default command for `git-submodule`.
Junio C Hamano38b693c2007-06-03 08:40:1440
41init::
Junio C Hamano16f98872007-06-12 16:09:1442Initialize the submodules, i.e. register in .git/config each submodule
Junio C Hamano7a4a2832007-07-07 21:53:2243name and url found in .gitmodules. The key used in .git/config is
44`submodule.$name.url`. This command does not alter existing information
Junio C Hamano16f98872007-06-12 16:09:1445in .git/config.
Junio C Hamano38b693c2007-06-03 08:40:1446
47update::
Junio C Hamano16f98872007-06-12 16:09:1448Update the registered submodules, i.e. clone missing submodules and
49checkout the commit specified in the index of the containing repository.
50This will make the submodules HEAD be detached.
Junio C Hamano0f7b5a92008-05-17 06:12:2351+
52If the submodule is not yet initialized, and you just want to use the
53setting as stored in .gitmodules, you can automatically initialize the
54submodule with the --init option.
Junio C Hamano38b693c2007-06-03 08:40:1455
Junio C Hamano8b588d52008-03-15 09:48:3756summary::
57Show commit summary between the given commit (defaults to HEAD) and
58working tree/index. For a submodule in question, a series of commits
59in the submodule between the given super project commit and the
60index or working tree (switched by --cached) are shown.
Junio C Hamano38b693c2007-06-03 08:40:1461
62OPTIONS
63-------
Junio C Hamanoeb415992008-06-08 22:49:4764-q::
65--quiet::
Junio C Hamano38b693c2007-06-03 08:40:1466Only print error messages.
67
Junio C Hamanoeb415992008-06-08 22:49:4768-b::
69--branch::
Junio C Hamano1d90cb02007-07-03 07:05:3170Branch of repository to add as submodule.
71
Junio C Hamano38b693c2007-06-03 08:40:1472--cached::
Junio C Hamano8b588d52008-03-15 09:48:3773This option is only valid for status and summary commands. These
74commands typically use the commit found in the submodule HEAD, but
75with this option, the commit stored in the index is used instead.
76
Junio C Hamanoeb415992008-06-08 22:49:4777-n::
78--summary-limit::
Junio C Hamano8b588d52008-03-15 09:48:3779This option is only valid for the summary command.
80Limit the summary size (number of commits shown in total).
Junio C Hamano1bdd3b02008-04-13 05:33:1881Giving 0 will disable the summary; a negative number means unlimited
Junio C Hamano8b588d52008-03-15 09:48:3782(the default). This limit only applies to modified submodules. The
83size is always limited to 1 for added/deleted/typechanged submodules.
Junio C Hamano38b693c2007-06-03 08:40:1484
85<path>::
86Path to submodule(s). When specified this will restrict the command
87to only operate on the submodules found at the specified paths.
88
89FILES
90-----
Junio C Hamano16f98872007-06-12 16:09:1491When initializing submodules, a .gitmodules file in the top-level directory
Junio C Hamano38b693c2007-06-03 08:40:1492of the containing repository is used to find the url of each submodule.
Junio C Hamano91baf102007-12-31 09:44:2693This file should be formatted in the same way as `$GIT_DIR/config`. The key
Junio C Hamano35738e82008-01-07 07:55:4694to each submodule url is "submodule.$name.url". See linkgit:gitmodules[5]
Junio C Hamanoe66c6c02007-12-17 08:26:1395for details.
Junio C Hamano38b693c2007-06-03 08:40:1496
97
98AUTHOR
99------
100Written by Lars Hjemli <hjemli@gmail.com>
101
102GIT
103---
Junio C Hamanof7c042d2008-06-06 22:50:53104Part of the linkgit:git[1] suite