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, --branch

branch of repository add submodule. name of branch recorded submodule.<name>.branch in .gitmodules update --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), defaulting origin. remote branch used defaults master, branch name may overridden setting submodule.<name>.branch option in either .gitmodules or .git/config (with .git/config taking 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

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -