github - How to bump specific git submodules? -
i need bump submodules of repository often. of submodules use branch master , use development. right know how bump versions git submodule foreach git pull origin branchname. fail , exit when branch uses opposite branch. example if ran master following error causing command exit.
fatal: couldn't find remote ref master stopping @ 'submodules-dir/repo-that-uses-development-branch'; script returned non-zero status. is there way either git submodule , enter single branch, pull down branch changes 1 @ time? or there way filter out branch name git submodule foreach git pull origin pull branch being used each submodule.
each submodule ordinary repository. what's special it's in detached head mode, i.e., not on branch.
you can, however, record branch name each submodule in submodule's superproject:
-b,--branchbranch of repository add submodule. name of branch recorded
submodule.<name>.branchin.gitmodulesupdate --remote. special value of . used indicate name of branch in submodule should same name current branch in current repository.
you can run git submodule update --remote:
this option valid update command. instead of using superproject’s recorded sha-1 update submodule, use status of submodule’s remote-tracking branch. remote used branch’s remote (
branch.<name>.remote), defaultingorigin. remote branch used defaultsmaster, branch name may overridden settingsubmodule.<name>.branchoption in either.gitmodulesor.git/config(with.git/configtaking precedence).
(aside: means if git config specific branch in superproject, overrides default configuration saved in .gitmodules file. .gitmodules file, since ordinary version-controlled file, gets carried around in superproject , exists on fresh clone, while .git/config settings specific current superproject clone.)
this works of supported update procedures (
--checkout,--rebase, etc.). change source of target sha-1. example ... [snip]
(for further details , examples, see the linked documentation).
Comments
Post a Comment