4

I want to pull code from the referenced submodules. I tried git submodule update --init which does not do anything.

Reading up, I realized that this could be perhaps because my .git/config file isnt set. My .git/config does not contain anything about the submodule.

.git/config:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = ssh://ShubhamRathi@gerrit.opnfv.org:29418/opnfvdocs
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[remote "gerrit"]
    url = ssh://ShubhamRathi@gerrit.opnfv.org:29418/opnfvdocs.git
    fetch = +refs/heads/*:refs/remotes/gerrit/*
[user]
    email = shubhamiiitbackup@gmail.com
[branch "Testingdoc"]
    remote = origin
    merge = refs/heads/master

However my .gitmodule contains the references to the submodules

[submodule "docs/testing/docs/submodules/apex"]
    path = docs/testing/docs/submodules/apex
    url = https://gerrit.opnfv.org/gerrit/apex
[submodule "docs/testing/docs/submodules/armband"]
    path = docs/testing/docs/submodules/armband
    url = https://gerrit.opnfv.org/gerrit/armband

My question is, how do I bring these both files in sync that on git submodule update --init, the relevant repositories are pulled up?

FlyingAura
  • 1,541
  • 5
  • 26
  • 41

1 Answers1

-3

you have to run

git submodule update

after running git submodule init

git submodule update is the one that really pulls all your submodules in and checkout a working copy of the referenced sha

Zennichimaro
  • 5,236
  • 6
  • 54
  • 78
  • That doesn't works because .git/config file is not changed. See https://stackoverflow.com/questions/42028437/how-to-change-git-submodules-url-locally/42035018?noredirect=1 – kikerrobles Jan 09 '20 at 13:21