diff options
author | Mark Levedahl <mlevedahl@gmail.com> | 2008-03-04 20:15:02 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-03-05 13:37:46 -0800 |
commit | d4264ca3233e206ea927bc94befda530683b5836 (patch) | |
tree | 0db376ac14806d3acd84590efc2f3b5cf85c7f84 /Documentation | |
parent | Revert "unpack-objects: prevent writing of inconsistent objects" (diff) | |
download | tgif-d4264ca3233e206ea927bc94befda530683b5836.tar.xz |
git-submodule - Allow adding a submodule in-place
When working in the top-level project, it is useful to create a new
submodule as a git repo in a subdirectory, then add that submodule to
the top-level in place.
This patch allows "git submodule add <intended url> subdir" to add the
existing subdir to the current project. The presumption is the user will
later push / clone the subdir to the <intended url> so that future
submodule init / updates will work.
Absent this patch, "git submodule add" insists upon cloning the subdir
from a repository at the given url, which is fine for adding an existing
project in, but less useful when adding a new submodule from scratch to an
existing project. The former functionality remains, and the clone is
attempted if the subdir does not already exist as a valid git repo.
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-submodule.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt index e818e6e789..b4d01605a5 100644 --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt @@ -18,8 +18,9 @@ COMMANDS -------- add:: Add the given repository as a submodule at the given path - to the changeset to be committed next. In particular, the - repository is cloned at the specified path, added to the + to the changeset to be committed next. If path is a valid + repository within the project, it is added as is. Otherwise, + repository is cloned at the specified path. path is added to the changeset and registered in .gitmodules. If no path is specified, the path is deduced from the repository specification. If the repository url begins with ./ or ../, it is stored as |