1

I create a repo "main", containing a submodule "sub0", containing a submodule "sub1":

mkdir sub0 && cd sub0 && git init && touch README.md && git add README.md && git commit -am "Initial" && cd ..
mkdir sub1 && cd sub1 && git init && git submodule add ../sub0 sub0 && git commit -am "Initial" && cd ..
mkdir main && cd main && git init && git submodule add ../sub1 sub1 && git commit -am "Initial" && cd ..

I also tried

git submodule update --init --recursive

in main, but it makes not difference for the following issue.

Now, I got to main/sub1/, and make a change to the submodule configuration:

git config submodule.sub0.update none

For some strange reason, this change ends up in ../.git/modules/sub1/config instead of in .gitmodules. Now, how do I push this change? git shows me no modified files in any of the repos.

Johannes
  • 2,901
  • 5
  • 30
  • 50
  • 1
    `git config` changes config, why do you expect it to change `.gitmodules`? Use `git config --file=.gitmodules`: https://stackoverflow.com/a/30675130/7976758 Found in https://stackoverflow.com/search?q=%5Bgit-submodules%5D+edit+%22.gitmodules%22 – phd May 19 '21 at 21:26
  • @phd thanks for explaining, that solved my problem. – Johannes May 20 '21 at 02:33

0 Answers0