Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 358
JuanPablo Avatar asked Jul 05 '11 22:07

JuanPablo


2 Answers

git clone --recursive

or

git submodule update --init --recursive

if you already cloned.

like image 120
Adam Dymitruk Avatar answered Oct 07 '22 18:10

Adam Dymitruk


I begin this command

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

for save the remotes in a .gitremotes file

like image 43
JuanPablo Avatar answered Oct 07 '22 20:10

JuanPablo