I have two repositories hosted in Bitbucket - I have an access key setup that I can use to clone each project individually. Repository A has repository B as a submodule.
On Windows... after successfully cloning the repo A, git submodule update --init
fails due to the following:
Cloning into 'C:/Path/to/submodules/B'...
git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and that the repository exists.
fatal: clone of 'git@bitbucket.org:org/B.git' into submodule path 'C:/path/to/submodules/B' failed
Failed to clone 'submodules/B'. Retry scheduled
The .gitmodules
setup is as the following
[submodule "submodules/B"]
path = submodules/B
url = git@bitbucket.org:org/B.git
...
If I take that URL as specified in the .gitmodules
and clone that repository, it works perfectly fine git clone git@bitbucket.org:org/B.git
It seems like repositories that are trying to be cloned via git submodule update --init
cannot see/use the ssh access key I have added.
Git Submodule - Permission Denied suggestions haven't worked
- maybe the key needs to be refreshed? No, the key works perfectly fine for downloading all other repositories
- maybe there is an issue with the key itself, try
ssh -vT git@github.com
After changing it tobitbucket.org
it works perfectly fine, with successful authentication. - I didn't have this problem with http :/ - I didn't either and I hate ssh for this, but, alas it's required.
How can resolve this issue? Or what configuration am I missing?
I will be doing this in a development docker container environment so it needs to not preclude that.
This is not like the following problems: