7

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

2 Answers 2

3
git clone --recursive

or

git submodule update --init --recursive

if you already cloned.

Sign up to request clarification or add additional context in comments.

2 Comments

but , "git submodule update --init --recursive" is for recursive pull ?
no. when you pull, you are only acting on that repository. Try git submodule foreach --recursive git pull --rebase. The rebase is optional.
2

I begin this command

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

for save the remotes in a .gitremotes file

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.