【发布时间】:2019-03-16 17:40:23
【问题描述】:
Git: Clone 在 Mac 上的 Visual Studio Code 中返回 Permission denied, please try again。从 Visual Studio Code 中的终端,它可以执行git clone。
在 Mac 上的 Visual Studio Code 中,我执行以下操作:
- 我愿意
Git: Clone 我输入了以下格式的 ssh 存储库 URL:
ssh://<username>@<repository-host>/<path>/<rep>.git我“选择存储库位置”文件夹,并得到以下对话框:
此功能从不要求我输入任何密码!
如果我打开 Git 日志,输出是这样的:
> git clone <ssh-repository-URL> <path>
Cloning into '<path>'...
Permission denied, please try again.
Permission denied, please try again.
Received disconnect from <IP> port 22:2: Too many authentication failures for <username>
Disconnected from <IP> port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
在终端中它可以工作:
mac:rep username$ git clone
Cloning into '<repository>'… <ssh-repository-URL>
The authenticity of host ‘<repository-host> (<repository-ip>)' can't be established.
ECDSA key fingerprint is SHA256:<fingerprint>.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '<repository-host>,<repository-ip>' (ECDSA) to the list of known hosts.
Password:
remote: ...
remote: ...
remote: …
Receiving objects: 100% (.../...), ... | ... MiB/s, done.
Resolving deltas: 100% (.../...), done.
关于为什么Git: Clone Visual Studio Code 从不询问服务器密码的任何线索?
【问题讨论】:
-
从你上面提到的,我认为VS Code拒绝远程是因为终端部分提到的真实性问题。您可以尝试使用
https而不是ssh克隆回购吗? -
@dstrants 谢谢。我将更新这个问题,因为 Git: Clone 永远不会询问存储库服务器的密码。在终端中,我可以输入密码。关于https,我认为我们的本地存储服务器不支持。
-
您是否为您的 ssh 密钥添加了密码?
-
@evolutionxbox 非常感谢!这个问题实际上使我找到了解决问题的方法,因为我不知道您只能在 Git 中使用 ssh URL:正确设置 ssh 密钥时克隆。
-
您可以添加您的解决方案作为答案吗?
标签: git macos visual-studio-code