【发布时间】:2021-03-11 15:23:52
【问题描述】:
我正在尝试通过 ssh 方式从 github 和另一种形式的 gitlab 克隆存储库
我在 Windows 上编辑:使用 Git v 2.29.2.2
我收到以下错误,我不明白它的来源:
$ git clone git@github.com:math-gallou/AI21_TPs.git
Cloning into 'AI21_TPs'...
git: 'git@github.com' is not a git command. See 'git --help'.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
所以我也试过了:
$ git clone "ssh://git@github.com:math-gallou/AI21_TPs.git"
和
$ git clone ssh://git@github.com:math-gallou/AI21_TPs.git
但同样的错误出现了。
当我执行ssh -v git@github.com 时,我可以成功连接。
那么我错过了什么?
【问题讨论】:
-
你安装了哪个版本的 Git-for-Windows?
-
提示(也许没有帮助,但无论如何):
ssh://URL 的语法略有不同:git clone ssh://git@github.com/math-gallou/AI21_TPs.git(斜杠/而不是冒号:)。见git-scm.com/docs/git-fetch#_git_urls