Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.git folder for Submodules

Tags:

git

github

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

ProjectRoot/.git/modules/SubmoduleX/config

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

ProjectRoot/SubmoduleX/.git/config

Why the discrepancy? When was this change done?

like image 814
Brian Liang Avatar asked Mar 11 '13 18:03

Brian Liang


1 Answers

You have got the versions the other way around?

The change was introduced in 1.7.8:

When populating a new submodule directory with "git submodule init", the $GIT_DIR metainformation directory for submodules is created inside $GIT_DIR/modules// directory of the superproject and referenced via the gitfile mechanism. This is to make it possible to switch between commits in the superproject that has and does not have the submodule in the tree without re-cloning.

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

like image 151
manojlds Avatar answered Sep 21 '22 14:09

manojlds