【问题标题】:How to clone repositories from server port 9418?如何从服务器端口 9418 克隆存储库?
【发布时间】:2022-01-21 17:21:21
【问题描述】:

我有一个在 9418 端口上运行 git 的服务器。

是否可以从该服务器列出或克隆所有 git 存储库?

它应该可以工作,但是对于某些 repo-name:

git clone git://ip/repo-name

【问题讨论】:

    标签: git clone git-clone


    【解决方案1】:

    Git protocol 不包括列表存储库。

    而且它不包括身份验证,这就是为什么您在公司环境中找不到它(无论如何端口 9418 都已关闭)

    否则,如果您的 git 守护程序正在服务器上运行,则像 git://<ip>:9418/repo 这样的 URL 应该可以工作。

    Example(从 2011 年开始,2021 年不太可能工作):

    git clone git://metaf2xml.git.sourceforge.net/gitroot/metaf2xml/metaf2xml
    

    2021:

    git clone git://git.code.sf.net/p/metaf2xml/code.git
    

    【讨论】:

    • 页面sourceforge.net/p/metaf2xml/code/ci/master/tree列出了当前工作的URL(从HTTPS切换到git://); git ls-remote git://git.code.sf.net/p/metaf2xml/code.git 工作。
    • @phd 谢谢。我已经用当前的git:// URL 更新了答案。现在看到这样的 URL 仍然有效总是令人惊讶。
    猜你喜欢
    • 2012-08-21
    • 2022-10-09
    • 1970-01-01
    • 2014-01-31
    • 2019-02-17
    • 1970-01-01
    • 2020-06-13
    • 2011-01-26
    • 2011-04-23
    相关资源
    最近更新 更多