If I add a submodule that does not currently exist, no submodule information is added to .git/config .
$ mkdir testing $ cd testing $ git init $ git submodule add git@git.server :submodule.git $ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true
However, if I add a repo that currently exists as a submodule, the URL is added to .git/config :
$ mkdir testing $ cd testing $ git init $ git clone git@git.server :submodule.git $ git submodule add git@git.server :submodule.git $ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true [submodule "submodule"] url = git@git.server :submodule.git
I would suggest that in both cases, git submodule add will only change .gitmodules , and that git submodule init updated the .git/config project.
Why is .git/config changed in the second case, but not the first? Can anyone explain the rationality of this behavior?
source share