pip install from a gitosis

帅比萌擦擦* 提交于 2019-11-29 20:33:10

问题


I have working gitosis repo. If I do

git clone git@server:repo.git

it clones the repo correctly. However, it does not work if I do:

git clone ssh://git@server:repo.git

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

The problem is that when I use pip I I do:

pip install git+ssh://git@server:repo.git

and of course yields:

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

If I want to do:

pip install git+git@server:repo.git 

I get

ValueError: ('Expected version spec in', 'git+git@server:repo.git', 'at', '+git@server:repo.git')

Is there a way to have pip or gitosis configured so I can make it work?

Thanks,

(please avoid 'use gitolite', I would if I could)


回答1:


I would rather use the ssh uri syntax (rather than the SCP syntax)

git clone git+ssh://git@server/repo.git



回答2:


To install, you should only have to run:

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

So for your example:

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


来源:https://stackoverflow.com/questions/9817976/pip-install-from-a-gitosis

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!