From b928922727d6691a3bdc28160f93f25712c565f6 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 Dec 2012 11:03:33 -0500 Subject: submodule add: If --branch is given, record it in .gitmodules This allows you to easily record a submodule..branch option in .gitmodules when you add a new submodule. With this patch, $ git submodule add -b [] $ git config -f .gitmodules submodule..branch reduces to $ git submodule add -b [] This means that future calls to $ git submodule update --remote ... will get updates from the same branch that you used to initialize the submodule, which is usually what you want. Signed-off-by: W. Trevor King Signed-off-by: Junio C Hamano --- Documentation/git-submodule.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Documentation') diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt index 8bf173a906..b1996f1a63 100644 --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt @@ -208,6 +208,8 @@ OPTIONS -b:: --branch:: Branch of repository to add as submodule. + The name of the branch is recorded as `submodule..branch` in + `.gitmodules` for `update --remote`. -f:: --force:: -- cgit v1.2.3