git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Init of submodule within subtree not working
@ 2019-03-13 15:06 Thomas Kitzinger
  0 siblings, 0 replies; only message in thread
From: Thomas Kitzinger @ 2019-03-13 15:06 UTC (permalink / raw)
  To: git

 Hello,

currently I’m having trouble using subtree to include a subproject
that itself contains submodules.

$ git subtree add --prefix folderB/subtreeproject https:\\xx master --squash

The resulting structure is something like the following:

superproject/
├── .git/
├── .gitmodules
└── folderA/
    ├── someFileA
    └── submoduleA /
└── folderB/
    ├── someFileB
    └── subtreeproject/   <= THE SUBTREE
        ├── .gitmodules
        ├── someFolder/
        └── submoduleInSubtree/   <= THE SUBMODULE IN SUBTREE

The subtreeproject contains its own submodule and therefore its own .gitmodules.

If I now run
$ git submodule update --init --remote
I get the error
fatal: No url found for submodule path
‘folderB/subtreeproject/submoduleInSubtree’ in .gitmodules

The only way I could get the submodule initialized is by manually
copying the contents of the folder/subtreeproject/.gitmodules to the
top-level .gitmodules and adjusting the path accordingly, which is
quite annoying.

Is this behavior intended? Isn’t there a more elegant solution?

Couldn’t git respect .gitmodules not only in the root directory but
also in any sub-directory? I learned it already works for submodules
within other submodules, but apparently not for submodules within
subtrees.

My git version:
$ git version 2.21.0.windows.1


Best regards

Thomas Kitzinger

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-13 15:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-13 15:06 Init of submodule within subtree not working Thomas Kitzinger

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).