2011-10-27 48 views
3

我是一名分支機構辦公室工作人員,並已將我現有的存儲庫上載到我公司的中央辦公室的ftp服務器上。中央辦公室正在使用微軟的ftp服務器。我無法在服務器上安裝任何東西,只能使用支持活動模式ftp的真實ftp客戶端連接/瀏覽到ftp服務器。通過活動FTP克隆git存儲庫

我曾嘗試使用以下命令行克隆:

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 

我也得到了以下錯誤消息:

error: Failed connect to ftp.company.com:21 ; No error while accessing ftp://companyDomain\[email protected]/project.repo/.git/info/refs fatal: HTTP request failed

當輸入上述命令我立即得到提示我輸入密碼。我輸入密碼,過了一段時間,然後收到上述錯誤消息。

要完全清楚我並不想將我的源頭版本推送到FTP服務器進行部署,所以像git-ftp,https://github.com/resmo/git-ftp這些東西根本不能幫助我。我想要做的是在ftp服務器上安裝我的repo,並且我的小團隊中的每個人都可以推送/獲取對ftp服務器上repo的更改。

git是否支持主動FTP? 發生了什麼事?

謝謝, 克里斯

+0

你可能要檢查這裏給出的答案:FTP服務器上的Git倉庫(http://stackoverflow.com/questions/5141205/git-repository- on-ftp-server) – yasouser

+0

已經查看過該答案及相關帖子 –

回答

8

他們是否使用默認的FTP端口?如果他們不這樣做,你需要聲明如下:

git clone ftp://username:[email protected]:PORTHERE/project.repo/.git 
0

嘗試

git clone ftp://username:[email protected]/project.repo/.git 
+0

沒有工作,同樣確切的錯誤信息 –

+0

對不起,這是我的一個想法。看着這些文檔,git不支持FTP,所以我很驚訝你能像你一樣。 – Dave

+0

我很感激幫助。從這個答案它看起來像支持ftp:http://stackoverflow.com/questions/5709192/git-clone-over-ftps/5709229#5709229 –

0

我也嘗試過所有的FTP例子,沒有任何工作。由於我的服務器PC是一臺Linux機器,我安裝了混帳然後可以克隆進行使用:

git clone username:servername:/folder1/folder2/repoFolder.git 

然後你會被要求輸入密碼。 如果安裝在服務器上沒有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.