How to use SSH instead of HTTP for Git submodules?

后端 未结 2 1163
遥遥无期
遥遥无期 2021-01-12 17:12

Why are people having this problem?

$ git clone --recursive git@github.com:acani/Chats.git Cloning into \'Chats\'... Permission denied (publickey). fatal: Could not

2条回答
  •  一个人的身影
    2021-01-12 17:27

    The SSH protocol doesn’t support anonymous access to a Git repository.

    So, don't use the SSH protocol. Instead, use either the Smart HTTP protocol (recommended) or the Git protocol.

    For every submodule URL in your repository's .gitmodules file, replace git@github.com: with either https://github.com/ (to use the Smart HTTP protocol) or git://github.com/ (to use the Git protocol).

    More info: Git - The Protocols

提交回复
热议问题