mirror of
https://github.com/git/git.git
synced 2026-04-11 09:20:10 +02:00
git-submodule: add "sync" command
When a submodule's URL changes upstream, existing submodules will be out of sync since their remote."$origin".url will still be set to the old value. This adds a "git submodule sync" command that reads submodules' URLs from .gitmodules and updates them accordingly. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
27a6ed492b
commit
2327f61ecc
@@ -15,6 +15,7 @@ SYNOPSIS
|
||||
'git submodule' [--quiet] update [--init] [--] [<path>...]
|
||||
'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]
|
||||
'git submodule' [--quiet] foreach <command>
|
||||
'git submodule' [--quiet] sync [--] [<path>...]
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
@@ -139,6 +140,14 @@ foreach::
|
||||
As an example, "git submodule foreach 'echo $path `git rev-parse HEAD`' will
|
||||
show the path and currently checked out commit for each submodule.
|
||||
|
||||
sync::
|
||||
Synchronizes submodules' remote URL configuration setting
|
||||
to the value specified in .gitmodules. This is useful when
|
||||
submodule URLs change upstream and you need to update your local
|
||||
repositories accordingly.
|
||||
+
|
||||
"git submodule sync" synchronizes all submodules while
|
||||
"git submodule sync -- A" synchronizes submodule "A" only.
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
|
||||
Reference in New Issue
Block a user