我正在尝试使用 TortoiseGit git 克隆一个存储库。我只能通过 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 git clone 我的私有(private)存储库。这很奇怪。我在使用 TortoiseGit 进行 SSH 时是否正确?
最佳答案
虽然我不熟悉 TortoiseGit,但看起来您应该使用一种语法,这种语法在许多通过 SSH 完成复制的应用程序中很常见。即:<username>@<server>:/path/to/thing/that/needs/copying
. (注意靠近中间的冒号。)
我建议更改您正在运行的命令,在 /home
之前放置一个冒号:
git.exe clone --progress -v "ssh://git@xx.xx.xx.xx:/home/git/git-repo/myproject.git" "C:\xampp\htdocs\myproject"
关于git - TortoiseGit:无法使用 SSH 在 VPS 上 Git 克隆私有(private)存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51924869/