{"thread":{"id":"50730","subject":"Init of submodule within subtree not working","startedAt":"2019-03-13T15:06:48Z","lastAt":"2019-03-13T15:06:48Z","messageCount":1,"participants":["Thomas Kitzinger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"371370","messageId":"CALYpq6_n_5kf5gFwki8cuUW=xSB80L4uoicSOL40OnohK1+h0Q@mail.gmail.com","threadId":"50730","inReplyTo":null,"subject":"Init of submodule within subtree not working","fromName":"Thomas Kitzinger","fromEmail":"th.kitzinger@gmail.com","sentAt":"2019-03-13T15:06:34Z","receivedAt":"2019-03-13T15:06:48Z","isPatch":false,"sender":{"key":"th.kitzinger@gmail.com","avatar":null},"body":" Hello,\n\ncurrently I’m having trouble using subtree to include a subproject\nthat itself contains submodules.\n\n$ git subtree add --prefix folderB/subtreeproject https:\\\\xx master --squash\n\nThe resulting structure is something like the following:\n\nsuperproject/\n├── .git/\n├── .gitmodules\n└── folderA/\n    ├── someFileA\n    └── submoduleA /\n└── folderB/\n    ├── someFileB\n    └── subtreeproject/   <= THE SUBTREE\n        ├── .gitmodules\n        ├── someFolder/\n        └── submoduleInSubtree/   <= THE SUBMODULE IN SUBTREE\n\nThe subtreeproject contains its own submodule and therefore its own .gitmodules.\n\nIf I now run\n$ git submodule update --init --remote\nI get the error\nfatal: No url found for submodule path\n‘folderB/subtreeproject/submoduleInSubtree’ in .gitmodules\n\nThe only way I could get the submodule initialized is by manually\ncopying the contents of the folder/subtreeproject/.gitmodules to the\ntop-level .gitmodules and adjusting the path accordingly, which is\nquite annoying.\n\nIs this behavior intended? Isn’t there a more elegant solution?\n\nCouldn’t git respect .gitmodules not only in the root directory but\nalso in any sub-directory? I learned it already works for submodules\nwithin other submodules, but apparently not for submodules within\nsubtrees.\n\nMy git version:\n$ git version 2.21.0.windows.1\n\n\nBest regards\n\nThomas Kitzinger\n"}]}