首页 > 解决方案 > TortoiseGit:无法使用 SSH 在 VPS 上 Git 克隆私有存储库

问题描述

我正在尝试使用 TortoiseGit 克隆一个存储库。我只能通过 SSH 访问我在 VPS 上的 git 存储库。我收到以下错误:

git.exe clone --progress -v "ssh://git@xx.xx.xx.xx/home/git/git-repo/myproject.git" "C:\xampp\htdocs\myproject"

Cloning into 'C:\xampp\htdocs\myproject'...
/usr/bin/bash: git@xx.xx.xx.xx: No such file or directory
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

但是,我可以在 Windows 上使用 Git Bash 克隆我的私有存储库。这很奇怪。使用 TortoiseGit 进行 SSH 时我做对了吗?

标签: gittortoisegit

解决方案


如果您更喜欢使用 ssh 密钥进行克隆,则需要创建 ssh 密钥并将其添加到 git 存储库 ssh 公钥。使用 ssh-keygen 生成您的 ssh 密钥


推荐阅读