通过活动 FTP 克隆 git 存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7919736/
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
clone git repository via active FTP
提问by Chris Andrews
I'm a branch office worker and have uploaded my existing repo to the ftp server at my company's central office. The central office is using Microsoft's ftp server. I have no access to install anything on the server and was only able to connect/browse to the ftp server using a real ftp client that supports active mode ftp.
我是一名分支机构工作人员,并将我现有的 repo 上传到我公司中央办公室的 ftp 服务器。中心办公室使用微软的 ftp 服务器。我无权在服务器上安装任何东西,只能使用支持主动模式 ftp 的真实 ftp 客户端连接/浏览到 ftp 服务器。
I have tried cloning with the following command lines:
我尝试使用以下命令行进行克隆:
git clone ftp://companyDomain\[email protected]/project.repo/.git
git clone ftp://[email protected]@ftp.company.com/project.repo/.git
git clone ftp://username%[email protected]/project.repo/.git
git clone ftp://username:[email protected]/project.repo/.git
And I get the following error message:
我收到以下错误消息:
error: Failed connect to
ftp.company.com:21
; No error while accessingftp://companyDomain\[email protected]/project.repo/.git/info/refs
fatal: HTTP request failed
错误:连接失败
ftp.company.com:21
;访问ftp://companyDomain\[email protected]/project.repo/.git/info/refs
致命时没有错误 :HTTP请求失败
When entering the above commands I immediately get prompted for my password. I enter the password, some time passes and then I received the above error message.
输入上述命令时,我立即收到输入密码的提示。我输入密码,过了一段时间,然后我收到了上述错误消息。
To be completely clear I'm am NOT looking to push the head version of my source to an FTP server for deployment, so things like git-ftp, https://github.com/resmo/git-ftp, don't help me out at all. What I want to do is have my repo on the ftp server and everyone on my very small team be able to push/fetch changes to the repo on the ftp server.
完全清楚,我不打算将我的源代码的头部版本推送到 FTP 服务器进行部署,所以像 git-ftp、https://github.com/resmo/git-ftp 之类的东西,没有帮助我出去了。我想要做的是将我的 repo 放在 ftp 服务器上,我非常小的团队中的每个人都能够推送/获取对 ftp 服务器上的 repo 的更改。
Does git support active FTP? What's going on?
git 支持主动 FTP 吗?这是怎么回事?
Thanks, Chris
谢谢,克里斯
回答by Chris McGuire
Do they use the default FTP port? If they don't, you need to declare it like so:
他们使用默认的 FTP 端口吗?如果他们不这样做,您需要像这样声明它:
git clone ftp://username:[email protected]:PORTHERE/project.repo/.git
回答by Dave
回答by Trivalik
I tried also all FTP examples here, none was working. Since my server pc is a linux machine I installed git on it and then can clone be done use:
我还尝试了此处的所有 FTP 示例,但都不起作用。由于我的服务器 pc 是一台 linux 机器,我在它上面安装了 git,然后可以使用克隆:
git clone username:servername:/folder1/folder2/repoFolder.git
Then you will be asked for password. If no git is installed on server you will get:
然后你会被要求输入密码。如果服务器上没有安装 git 你会得到:
sh: git-upload-pack: not found
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.