This is such a bizarre thing. I’m trying to add local repo ProjectB as a submodule of ProjectA. I’m very familiar with the process and commands to work with submodules, but trying to run git submodule add ../ProjectB Project
in the root of ProjectA causes git to try to clone from Github, not the local repo (I’ve omitted from this the other submodule commands, but they were run). I’ve tried multiple times, resetting everything each time (.gitmodules, .git/config, .git/modules/ProjectB)
I’m not sure if that’s a bug or a questionable design choice, but digging in I ran GIT_TRACE=1 GIT_CURL_VERBOSE=1 git submodule add --force ../ProjectB ProjectB
and indeed it is trying to clone from Github.
So–I remove all references to Github from ProjectB: package.json, git remote, everything I could find. I’m pretty sure I got them all, but when I try the above again, it still resolves to Github instead of the local repo.
I am looking for an explanation of this behavior, not the unfortunately common “Why are you using submodules?” style of non-answer.
Does someone have an explanation for this behavior? It doesn’t make sense how git even KNOWS where that repo is on Github since I’ve removed all references to Github from ProjectB.