t5000: tar portability fix
[git/dscho.git] / Documentation / git-submodule.txt
blob6ffd896fbc78b783a7e00ed462f879cbff29d758
1 git-submodule(1)
2 ================
4 NAME
5 ----
6 git-submodule - Initialize, update or inspect submodules
9 SYNOPSIS
10 --------
11 [verse]
12 'git-submodule' [--quiet] add [-b branch] [--] <repository> [<path>]
13 'git-submodule' [--quiet] status [--cached] [--] [<path>...]
14 'git-submodule' [--quiet] [init|update] [--] [<path>...]
15 'git-submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]
18 COMMANDS
19 --------
20 add::
21         Add the given repository as a submodule at the given path
22         to the changeset to be committed next.  If path is a valid
23         repository within the project, it is added as is. Otherwise,
24         repository is cloned at the specified path. path is added to the
25         changeset and registered in .gitmodules.   If no path is
26         specified, the path is deduced from the repository specification.
27         If the repository url begins with ./ or ../, it is stored as
28         given but resolved as a relative path from the main project's
29         url when cloning.
31 status::
32         Show the status of the submodules. This will print the SHA-1 of the
33         currently checked out commit for each submodule, along with the
34         submodule path and the output of linkgit:git-describe[1] for the
35         SHA-1. Each SHA-1 will be prefixed with `-` if the submodule is not
36         initialized and `+` if the currently checked out submodule commit
37         does not match the SHA-1 found in the index of the containing
38         repository. This command is the default command for git-submodule.
40 init::
41         Initialize the submodules, i.e. register in .git/config each submodule
42         name and url found in .gitmodules. The key used in .git/config is
43         `submodule.$name.url`. This command does not alter existing information
44         in .git/config.
46 update::
47         Update the registered submodules, i.e. clone missing submodules and
48         checkout the commit specified in the index of the containing repository.
49         This will make the submodules HEAD be detached.
51 summary::
52         Show commit summary between the given commit (defaults to HEAD) and
53         working tree/index. For a submodule in question, a series of commits
54         in the submodule between the given super project commit and the
55         index or working tree (switched by --cached) are shown.
57 OPTIONS
58 -------
59 -q, --quiet::
60         Only print error messages.
62 -b, --branch::
63         Branch of repository to add as submodule.
65 --cached::
66         This option is only valid for status and summary commands.  These
67         commands typically use the commit found in the submodule HEAD, but
68         with this option, the commit stored in the index is used instead.
70 -n, --summary-limit::
71         This option is only valid for the summary command.
72         Limit the summary size (number of commits shown in total).
73         Giving 0 will disable the summary; a negative number means unlimited
74         (the default). This limit only applies to modified submodules. The
75         size is always limited to 1 for added/deleted/typechanged submodules.
77 <path>::
78         Path to submodule(s). When specified this will restrict the command
79         to only operate on the submodules found at the specified paths.
81 FILES
82 -----
83 When initializing submodules, a .gitmodules file in the top-level directory
84 of the containing repository is used to find the url of each submodule.
85 This file should be formatted in the same way as `$GIT_DIR/config`. The key
86 to each submodule url is "submodule.$name.url".  See linkgit:gitmodules[5]
87 for details.
90 AUTHOR
91 ------
92 Written by Lars Hjemli <hjemli@gmail.com>
94 GIT
95 ---
96 Part of the linkgit:git[7] suite