2012-03-22 174 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