Git add remote access to submodule

The .gitmodule file has a list of url and path submodules similar to this

[submodule ".vim/bundle/subRepo"] path = .vim/bundle/subRepo url = https://git.com/sub/repo 

and in .git / config of the main repo there is a list of remotes

 [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git@otherRepo.com 

when

  git submodule init git submodule update 

I get submodules.

how to add once a list of remotes in a submodule? don't write every time

 git remote add remoteAlias git://... 

in each submodule

+6
source share
2 answers

I'm starting this team

https://github.com/juanpabloaj/git-remote-init

to save remotes in a .gitremotes file

+2
source
 git clone --recursive 

or

 git submodule update --init --recursive 

if you have already cloned.

+2
source

Source: https://habr.com/ru/post/892079/


All Articles