author | Mark Levedahl <mlevedahl@gmail.com> | |
Wed, 5 Mar 2008 01:15:02 +0000 (20:15 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Mar 2008 21:37:46 +0000 (13:37 -0800) | ||
commit | d4264ca3233e206ea927bc94befda530683b5836 | |
tree | 0db376ac14806d3acd84590efc2f3b5cf85c7f84 | tree | snapshot |
parent | c95b3ad9ea310ec89e31a21edecaaf2c374e2c46 | commit | diff |
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>
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>
Documentation/git-submodule.txt | diff | blob | history | |
git-submodule.sh | diff | blob | history |