Home > Net >  Cannot initialize submodule (branch of private repository)
Cannot initialize submodule (branch of private repository)

Time:11-10

Please observe that I have two branches in a private repository: master and content, the latter being a submoudle of the former -

image

git clone --recurse-submodules https://github.com/vishvAsa/rahaShTippanyaH.git succeds just fine - except for the submodule content.

The below fails as well:

git submodule update --init --remote                                                                 ✔  5m 9s  
Cloning into '/home/vvasuki/gitland/vishvAsa/rahaShTippanyaH/content'...
sign_and_send_pubkey: signing failed for RSA "[email protected]" from agent: agent refused operation
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

But the error mentioned does not make sense since I was able to clone the exact same private repository without the content submodule. Further ssh-add -l shows an rss key.

Is this a github bug? How to fix? (Switching submodule upstream to https://github.com/vishvAsa/rahaShTippanyaH.git or https://[email protected]/vishvAsa/rahaShTippanyaH.git did not help.)

CodePudding user response:

Switching to the HTTPS URL should have helped, since the initial clone succeeds.

But try and set GIT_SSH_COMMAND:

export GIT_SSH_COMMAND='ssh -Tv'

That way, you will see which key is tried for this clone.
Check also that ssh -Tv [email protected] does return Hi vvasuki! You've successfully authenticated, but GitHub does not provide shell access.
As long as this first check does not succeed, any SSH URL would fail.

  • Related