7

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)

Hernan
  • 5,811
  • 10
  • 51
  • 86

2 Answers2

8

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

git clone git+ssh://git@server/repo.git
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 4
    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. – Mark Hildreth May 02 '13 at 23:16
0

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
David Lemphers
  • 3,568
  • 3
  • 18
  • 10
  • I cannot do it like this. I need to access via ssh. – Hernan Jun 11 '12 at 20:38
  • 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? – David Lemphers Jun 13 '12 at 22:15