3

So I know about git submodules and subtrees. But I also used to be able to have nested full Git repositories treated as nothing simple filesystem subdirectories?

For example, given:

topdir/
    file1
    file2
    subdir1/
        file1
        file2
    subdir2/
        file1
        file2
    subdir3/
        .git/
        file1
        file2

Previously, simply executing:

$ git init && git commit -a .

in topdir would result in the files of subdir3 being committed as a raw or literal subdirectory (i.e. not a submodule), with the '.git' directory in the subdirectory ignored in the super- or top-level repository. Entering subdir3 would make subdir3/.git to current repository.

With 1.8.2.1.501, there does not seem to be any way to get this behavior back. Running the above command now results in subdir3 being considered a submodule but, perversely not added to the index. I have to explicitly do a git submodule add to add the files under it to the main repo.

When did this change happen?

Is there any way to get the old behavior back, i.e., have the subdirectory treated as a regular directory, and not a git submodule or subtree?

Jeet
  • 38,594
  • 7
  • 49
  • 56
  • Nested git repos have always been ignored, beside a gitlink, no? See http://stackoverflow.com/a/5981099/6309 (2011) – VonC Apr 06 '14 at 12:46
  • EDIT: Ok, maybe they were tracked through the mechanism described above. But that has changed? OLD:I definitely have repos with nested git repos treated as regular directories on my filesystem. When these are cloned, the nested repos do not show up as Git repos in the clone (i.e., there is no `.git` sub-directory in what were the nested repos in the original). I cannot figure out how to tell which version of Git created these repos originally, though. – Jeet Apr 06 '14 at 13:07
  • I don't think *any* git version would allow this, the closest being a merge subtree. – VonC Apr 06 '14 at 13:09
  • Any clues ? I need this (git treat nested git repos as plain old directories) – Mr_and_Mrs_D Sep 18 '14 at 20:14

0 Answers0