pip install from a gitosis

Tag: git , ssh , pip , gitosis Author: jeccygreen Date: 2012-03-06

I have working gitosis repo. If I do

git clone [email protected]:repo.git

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

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

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

pip install git+ssh://[email protected]: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 [email protected]:repo.git 

I get

ValueError: ('Expected version spec in', '[email protected]:repo.git', 'at', '[email protected]: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)

Other Answer1

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

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

comments:

To anyone looking at this and thinking, "That IS what I did!", notice that after server there is a / rather than a :. This is what I needed to change from my usual syntax in order to get pip to work correctly.

Other Answer2

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

comments:

I cannot do it like this. I need to access via ssh.
Sorry, just re-read your original post. I actually think it might be a firewall issue, as git uses different ports to ssh. What happens if you do a ssh -T to your server, are you able to connect?