From 7dce19d374a37932e9d4c3a6202af407cf5114eb Mon Sep 17 00:00:00 2001 From: Jens Lehmann Date: Fri, 12 Nov 2010 13:54:52 +0100 Subject: fetch/pull: Add the --recurse-submodules option Until now you had to call "git submodule update" (without -N|--no-fetch option) or something like "git submodule foreach git fetch" to fetch new commits in populated submodules from their remote. This could lead to "(commits not present)" messages in the output of "git diff --submodule" (which is used by "git gui" and "gitk") after fetching or pulling new commits in the superproject and is an obstacle for implementing recursive checkout of submodules. Also "git submodule update" cannot fetch changes when disconnected, so it was very easy to forget to fetch the submodule changes before disconnecting only to discover later that they are needed. This patch adds the "--recurse-submodules" option to recursively fetch each populated submodule from the url configured in the .git/config of the submodule at the end of each "git fetch" or during "git pull" in the superproject. The submodule paths are taken from the index. The hidden option "--submodule-prefix" is added to "git fetch" to be able to print out the full paths of nested submodules. Signed-off-by: Jens Lehmann Signed-off-by: Junio C Hamano --- Documentation/fetch-options.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Documentation') diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 9333c42c55..7f8d562efc 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -60,6 +60,16 @@ endif::git-pull[] flag lets all tags and their associated objects be downloaded. +--recurse-submodules:: + Use this option to fetch new commits of all populated submodules too. + +ifndef::git-pull[] +--submodule-prefix=:: + Prepend to paths printed in informative messages + such as "Fetching submodule foo". This option is used + internally when recursing over submodules. +endif::git-pull[] + -u:: --update-head-ok:: By default 'git fetch' refuses to update the head which -- cgit v1.2.3