Brian Liang
Brian Liang

Reputation: 7774

.git folder for Submodules

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?

Upvotes: 9

Views: 3112

Answers (2)

linquize
linquize

Reputation: 20406

Can centralize all metadata in the .git folder in root repository folder.

This is called separate git dir.

Upvotes: 0

manojlds
manojlds

Reputation: 301497

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

Upvotes: 12

Related Questions