.git for submodules

In one version of git we have (git version 1.7.4.4 ):

 ProjectRoot/.git/modules/SubmoduleX/config 

However, on another computer we have (git version 1.7.12.4 (Apple Git-37) ):

 ProjectRoot/SubmoduleX/.git/config 

Why the discrepancy? When was this change made?

+4
source share
2 answers

Do you have versions differently?

The change was introduced in 1.7.8 :

When filling out a new submodule directory with the gitinit submodule ", the metadata directory $ GIT_DIR for submodules created inside the $ GIT_DIR / modules // superproject and links through the gitfile mechanism. This allows you to switch between commits in a superproject that has and does not have a submodule in the tree without re-cloning.

https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.8.txt

+8
source

You can centralize all the metadata in the .git folder in the root repository folder.

This is called a separate git dir.

0
source

All Articles