【问题标题】:pip install from a gitosis从 gitosis 安装 pip
【发布时间】:2012-04-06 18:14:45
【问题描述】:

我有工作 gitosis 回购。如果我这样做了

git clone git@server:repo.git

它正确地克隆了 repo。但是,如果我这样做,它就不起作用:

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

问题是,当我使用pip 时,我会这样做:

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

当然还有产量:

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

如果我想做:

pip install git+git@server:repo.git 

我明白了

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

有没有办法配置 pip 或 gitosis 以便我可以让它工作?

谢谢,

(请避免“使用 gitolite”,如果可以的话,我会这样做)

【问题讨论】:

    标签: git ssh pip gitosis


    【解决方案1】:

    我宁愿使用ssh uri syntax(而不是SCP语法)

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

    【讨论】:

    • 对于任何看到这个并想“这就是我所做的!”的人,请注意在server 之后有一个/ 而不是:。为了让 pip 正常工作,我需要改变我通常的语法。
    【解决方案2】:

    要安装,您只需运行:

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

    所以对于你的例子:

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

    【讨论】:

    • 我不能这样。我需要通过 ssh 访问。
    • 抱歉,请重新阅读您的原始帖子。我实际上认为这可能是一个防火墙问题,因为 git 使用不同的端口来 ssh。如果你对你的服务器执行 ssh -T 会发生什么,你能连接吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-04
    • 2015-03-25
    相关资源
    最近更新 更多