Answer the question
In order to leave comments, you need to log in
How to access submodule repositories?
After development, the project was transferred to the production server.
A project with two submodules - one from a public repository, the other from a private one.
Submodules will not be updated even from the public repository:
> git submodule update
Cloning into 'local/components/xxx'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Clone of '[email protected]:Author/repo' into submodule path 'local/components/xxx' failed
Answer the question
In order to leave comments, you need to log in
Part of the answer is this:
Create separate ssh keys for each repository and add them as deployment keys.
Create a .ssh/config file like this:
Host github.com-repo-1
Hostname github.com
IdentityFile=/home/bitrix/.ssh/id_rsa-repo-1
Host github.com-repo-2
Hostname github.com
IdentityFile=/home/bitrix/.ssh/id_rsa-repo-2
Host github.com-repo-3
Hostname github.com
IdentityFile=/home/bitrix/.ssh/id_rsa-repo-3
git clone [email protected]:Author/repo.git .
git config submodule.local/sources.url [email protected]:Author/repo2.git
git submodule init
git submodule update
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question