通过 SFTP 克隆 Git 存储库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9163295/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 06:26:41  来源:igfitidea点击:

Cloning a Git repository over SFTP

gitsshsftp

提问by J K

I get a fatal error every time I try to clone my Git repository:

每次尝试克隆我的 Git 存储库时,我都会收到一个致命错误:

I run this:

我运行这个:

$ git clone sftp://[email protected]/git/foobar.git

and I get this:

我明白了:

fatal: Unable to find remote helper for 'sftp'

I'm trying to clone from one server to another, both of which use SSH authentication.

我正在尝试从一台服务器克隆到另一台服务器,两者都使用 SSH 身份验证。

Is there something I need to install to enable this SFTP remote helper?

我需要安装什么才能启用这个 SFTP 远程助手吗?

Thanks in advance for any advice you can offer!

预先感谢您提供的任何建议!

回答by sschuberth

To make jdi's comment from above more explicit: There is no sftp remote helper in Git. Available remote helpersinclude git-remote-ftps, but ftps(FTP over SSL) and sftp(SSH File Transfer Protocol) are fundamentally different protocols. That said, using ftps to clone a Git repository is rather uncommon, you probably want to use ssh instead.

为了使jdi上面的评论更加明确:Git 中没有 sftp 远程助手。可用的远程助手包括 git-remote- ftps,但ftps(基于SSL 的 FTP)和sftpSSH 文件传输协议)是根本不同的协议。也就是说,使用 ftps 克隆 Git 存储库相当不常见,您可能想改用 ssh。