summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLibravatar Peter Hutterer <peter.hutterer@who-t.net>2009-04-24 09:06:38 +1000
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-04-24 01:20:25 -0700
commitca2cedba70e9356a1a20b0e39acd07ab92fee80e (patch)
tree4499831d6ce4549bf5cb25204c7b3f5813b52398 /Documentation
parentMerge branch 'jc/maint-read-tree-multi' (diff)
downloadtgif-ca2cedba70e9356a1a20b0e39acd07ab92fee80e.tar.xz
git-submodule: add support for --rebase.
'git submodule update --rebase' rebases your local branch on top of what would have been checked out to a detached HEAD otherwise. In some cases, detaching the HEAD when updating a submodule complicates the workflow to commit to this submodule (checkout master, rebase, then commit). For submodules that require frequent updates but infrequent (if any) commits, a rebase can be executed directly by the git-submodule command, ensuring that the submodules stay on their respective branches. git-config key: submodule.$name.rebase (bool) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-submodule.txt14
-rw-r--r--Documentation/gitmodules.txt3
2 files changed, 15 insertions, 2 deletions
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 3b8df44673..0286409744 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -12,7 +12,7 @@ SYNOPSIS
'git submodule' [--quiet] add [-b branch] [--] <repository> <path>
'git submodule' [--quiet] status [--cached] [--] [<path>...]
'git submodule' [--quiet] init [--] [<path>...]
-'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--] [<path>...]
+'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--] [<path>...]
'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]
'git submodule' [--quiet] foreach <command>
'git submodule' [--quiet] sync [--] [<path>...]
@@ -113,7 +113,8 @@ init::
update::
Update the registered submodules, i.e. clone missing submodules and
checkout the commit specified in the index of the containing repository.
- This will make the submodules HEAD be detached.
+ This will make the submodules HEAD be detached unless '--rebase' is
+ specified or the key `submodule.$name.rebase` is set to `true`.
+
If the submodule is not yet initialized, and you just want to use the
setting as stored in .gitmodules, you can automatically initialize the
@@ -177,6 +178,15 @@ OPTIONS
This option is only valid for the update command.
Don't fetch new objects from the remote site.
+--rebase::
+ This option is only valid for the update command.
+ Rebase the current branch onto the commit recorded in the
+ superproject. If this option is given, the submodule's HEAD will not
+ be detached. If a a merge failure prevents this process, you will have
+ to resolve these failures with linkgit:git-rebase[1].
+ If the key `submodule.$name.rebase` is set to `true`, this option is
+ implicit.
+
<path>...::
Paths to submodule(s). When specified this will restrict the command
to only operate on the submodules found at the specified paths.
diff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt
index d1a17e2625..7c22c40949 100644
--- a/Documentation/gitmodules.txt
+++ b/Documentation/gitmodules.txt
@@ -30,6 +30,9 @@ submodule.<name>.path::
submodule.<name>.url::
Defines an url from where the submodule repository can be cloned.
+submodule.<name>.rebase::
+ Defines that the submodule should be rebased by default.
+
EXAMPLES
--------