summaryrefslogtreecommitdiff
path: root/Documentation/git-submodule.txt
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2012-10-29 04:12:12 -0400
committerLibravatar Jeff King <peff@peff.net>2012-10-29 04:12:12 -0400
commitfdb4d27158e4f8e19ac3b11b896bff92038afbfa (patch)
treef402de20fbac8f24b516426ed5eaf9c537515885 /Documentation/git-submodule.txt
parentMerge branch 'jl/submodule-rm' (diff)
parentsubmodule add: Fail when .git/modules/<name> already exists unless forced (diff)
downloadtgif-fdb4d27158e4f8e19ac3b11b896bff92038afbfa.tar.xz
Merge branch 'jl/submodule-add-by-name'
If you remove a submodule, in order to keep the repository so that "git checkout" to an older commit in the superproject history can resurrect the submodule, the real repository will stay in $GIT_DIR of the superproject. A later "git submodule add $path" to add a different submodule at the same path will fail. Diagnose this case a bit better, and if the user really wants to add an unrelated submodule at the same path, give the "--name" option to give it a place in $GIT_DIR of the superproject that does not conflict with the original submodule. * jl/submodule-add-by-name: submodule add: Fail when .git/modules/<name> already exists unless forced Teach "git submodule add" the --name option
Diffstat (limited to 'Documentation/git-submodule.txt')
-rw-r--r--Documentation/git-submodule.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index b4683bba1b..1d6527ab9f 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -9,7 +9,7 @@ git-submodule - Initialize, update or inspect submodules
SYNOPSIS
--------
[verse]
-'git submodule' [--quiet] add [-b branch] [-f|--force]
+'git submodule' [--quiet] add [-b branch] [-f|--force] [--name <name>]
[--reference <repository>] [--] <repository> [<path>]
'git submodule' [--quiet] status [--cached] [--recursive] [--] [<path>...]
'git submodule' [--quiet] init [--] [<path>...]
@@ -265,6 +265,11 @@ OPTIONS
Initialize all submodules for which "git submodule init" has not been
called so far before updating.
+--name::
+ This option is only valid for the add command. It sets the submodule's
+ name to the given string instead of defaulting to its path. The name
+ must be valid as a directory name and may not end with a '/'.
+
--reference <repository>::
This option is only valid for add and update commands. These
commands sometimes need to clone a remote repository. In this case,