When you checkout a submodule (for example, Vector via git submodule update --init skins/Vector
), the repository for the submodule is on a specific commit, not a branch. That is the cause of the You are not currently on a branch
message.
Release branches for MediaWiki have submodules for all the extensions but the measter branch does not. Which means that, yes, you can use git submodule update --init --recursive
on release branches for those extensions included in the release branch, but not on master, as a general rule. (That last submodule command will not change anything if your parent repository is on the same revision as it was when you initially checked out the submodules.)
The exception to this rule for master is if you used git to create submodules for the extensions you install. If you add the Foo extension via git submodule add -f http://example.com/foo.git extensions/Foo
, then you can update it later using a git submodule
command. If you just want to update the already checked-out branches for any submodules, then the command you're looking for is git submodule foreach git pull
.