仅通过sftp连接使用git pull/push

仅通过sftp连接使用git pull/push,git,curl,sftp,ftps,Git,Curl,Sftp,Ftps,我需要在两台主机之间同步一个git存储库,这两台主机只能通过专用的仅sftp的服务器相互通信 据我所知,git带有ftps,但没有sftp助手 根据《远程助手手册》: Git comes with a "curl" family of remote helpers, that handle various transport protocols, such as git-remote-http, git-remote-https, git-remote-ftp and git-

我需要在两台主机之间同步一个git存储库,这两台主机只能通过专用的仅sftp的服务器相互通信

据我所知,git带有ftps,但没有sftp助手

根据《远程助手手册》:

   Git comes with a "curl" family of remote helpers, that handle various transport
   protocols, such as git-remote-http, git-remote-https, git-remote-ftp and
   git-remote-ftps. They implement the capabilities fetch, option, and push.
根据
man curl
curl同时支持FTP和sftp:

   curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS,
   LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP).  The command is designed to work without user interaction.
由于curl理解这两种协议,并且最终都应该提供几乎相同的特性,那么有什么好的理由可以解释为什么ftp有一个助手,而sftp没有


我目前正在考虑实现自己的
git-remote-sftp
,类似于
git-remote-testgit
。有没有更好的方法让我错过了?

您可以使用远程存储库(例如,自托管或bitbucket等)作为暂存点吗?也就是说,在
hostA
run
git-push
上将更新推送到远程,在
hostB
run
git-pull
上从远程拉取更新。不,主机位于不同的生产网络中。只能使用专用sftp服务器进行通信。