JuanPablo
JuanPablo

Reputation: 24774

git add remote in submodule

the .gitmodule file have the list of submodule url and path, similar to this

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

and in the .git/config of core repo have list of remotes

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = [email protected]

when

 git submodule init
 git submodule update

I get the submodules.

how add one time the list of remotes in a submodule ? for not write everytime

git remote add remoteAlias git://... 

in each submodule

Upvotes: 7

Views: 10885

Answers (2)

JuanPablo
JuanPablo

Reputation: 24774

I begin this command

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

for save the remotes in a .gitremotes file

Upvotes: 2

Adam Dymitruk
Adam Dymitruk

Reputation: 129654

git clone --recursive

or

git submodule update --init --recursive

if you already cloned.

Upvotes: 3

Related Questions