1

I have a public submodule:

[submodule "submodules/quickstart-microsoft-utilities"]
    path = submodules/quickstart-microsoft-utilities
    url = git@github.com:aws-quickstart/quickstart-microsoft-utilities.git

It does not init or produce any errors. I have keys in Github but this is public. The main repo that references the git submodules is private, but clones fine. Changing it to https works fine:

[submodule "submodules/quickstart-microsoft-utilities"]
    path = submodules/quickstart-microsoft-utilities
    url = https://aws-quickstart/quickstart-microsoft-utilities.git

Cloning via SSH on this public repo outside a submodule works fine:

git clone git@github.com:aws-quickstart/quickstart-microsoft-utilities.git

What gives?

chum of chance
  • 6,200
  • 10
  • 46
  • 74
  • let the user of your submodule decide how to clone it or include it. I usually use https for anonymous cloning. – strobelight Apr 09 '21 at 20:42
  • Reading your question, I'm not clear what sort of error you're seeing. But generally, configure submodules meant for public consumption to use `https://`, and if you want to have them cloned locally using `ssh`, configure some `url.*.insteadof` options in your global git config. – larsks Apr 09 '21 at 20:56
  • I'm not seeing ANY error, it just silently fails. I assumed it was a git setting but I'm going to keep it as https – chum of chance Apr 09 '21 at 21:10

1 Answers1

0

First, make sure your HTTPS includes github.com, or it won't work either.

Second try (with a recent Git version) a

git config -l --show-scope --show-origin | grep -i insteadof

Check if any setting would silently replace your SSH URL by anything else.

Regarding the (silent) error, try and git clone --recurse-submodules with traces.
You have since Git 2.25 the variable GIT_TRACE2, and git fetch has been instrumented to emit traces.

 # Windows
 set GIT_TRACE2_EVENT=1

 # Linux
 export GIT_TRACE2_EVENT=1

 # run git clone
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250