我正在使用windows EDIT : with Git v2.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时,我可以与成功联系在一起。
那么我错过了什么?
发布于 2020-11-29 22:31:57
首先,如果您尝试使用ssh://语法,则URL将为:
git clone ssh://git@github.com/math-gallou/AI21_TPs.git
^^^ /, not :其次,检查是否有一个包含github.com主机条目的%USERPROFILE%\.ssh\config文件,其内容可能不正确或被错误解释。
发布于 2020-12-21 09:48:17
在我的例子中,我定义了系统环境变量GIT_SSH来使用我安装的openssh,然后git坏了,我得到了git: 'git@github.com' is not a git command. See 'git --help'.。
删除系统环境变量GIT_SSH后,一切都会再次正常工作。
然后,我尝试定义用户环境变量GIT_SSH并重新启动系统(我在之前的尝试中没有重新启动系统),不知何故,现在我的git可以与我安装的openssh正常工作了。我不知道在我之前的尝试中哪部分是错的,但我决定不在这上面浪费更多的时间。
https://stackoverflow.com/questions/65061142
复制相似问题