2012-03-22 171 views
7

我有工作gitosis回購。如果我做從gitosis pip安裝

git clone [email protected]:repo.git 

它正確地克隆回購。但是,這是行不通的,如果我做的:

git clone ssh://[email protected]:repo.git 

Cloning into repo... 
ssh: connect to host port 22: Connection refused 
fatal: The remote end hung up unexpectedly 

的問題是,當我使用pip II做:

pip install git+ssh://[email protected]:repo.git 

的,當然收益率:

Cloning into repo... 
ssh: connect to host port 22: Connection refused 
fatal: The remote end hung up unexpectedly 

如果我想要做:

pip install [email protected]:repo.git 

我得到

ValueError: ('Expected version spec in', '[email protected]:repo.git', 'at', '[email protected]:repo.git') 

有沒有辦法有點子或Gitosis的配置,所以我可以使它工作嗎?

感謝,

(請避免 '使用gitolite',我想如果我可以)

回答

8

我寧願使用ssh uri syntax(而不是SCP語法)

git clone git+ssh://[email protected]/repo.git 
+4

對於任何人在看這個和思考「這就是我做的!」,請注意,在'server'後有'/'而不是':'。這是我需要改變我平常的語法,以便讓點子正常工作。 – 2013-05-02 23:16:22

0

安裝,你應該只需要運行:

pip install git+git://host/path_to_repo/repo.git 

因此,對於您的示例:

pip install git+git://server/path_to_repo/repo.git 
+0

我不能這樣做。我需要通過SSH訪問。 – Hernan 2012-06-11 20:38:13

+0

對不起,只需重新閱讀原文。我實際上認爲它可能是防火牆問題,因爲git使用不同的端口ssh。如果你對服務器執行ssh -T會發生什麼,你能連接嗎? – 2012-06-13 22:15:52