【问题标题】:hosting git repository, can't clone: ssh error: bad file number托管 git 存储库,无法克隆:ssh 错误:文件编号错误
【发布时间】:2011-11-15 22:13:27
【问题描述】:

我遵循了本教程:http://www.jeremyskinner.co.uk/2010/07/31/hosting-a-git-server-under-apache-on-windows/ 在 Windows 服务器上托管 git 存储库

步骤: 安装 git 并创建一个测试存储库 安装 Apache(我使用的是 wamp 服务器,它是在 git 之前安装的) 编辑httpd.conf,添加:

<Directory />
    Allow from all
</Directory>
SetEnv GIT_PROJECT_ROOT C:/wamp/www/repositories
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAliasMatch \
        "(?x)^/(.*/(HEAD | \
                        info/refs | \
                        objects/(info/[^/]+ | \
                                 [0-9a-f]{2}/[0-9a-f]{38} | \
                                 pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
                        git-(upload|receive)-pack))$" \
                        "C:/Program Files/Git/libexec/git-core/git-http-backend.exe/$1"

我知道这很不安全,但我只是想先让基础知识发挥作用 所以我重新启动apache 然后我尝试使用以下命令从台式计算机克隆存储库:

git clone xxx.xxx.xxx.xxx:xxxx/repositories/Test.git

输出是:

Cloning into Test...
ssh: connect to host smarttelecom.no-ip.org port 22: Bad file number
fatal: The remote end hung up unexpectedly

我做错了什么?

【问题讨论】:

    标签: windows apache git ssh clone


    【解决方案1】:

    您必须使用 HTTP 端口。默认情况下,git 使用您不想要的 ssh。尝试在网址前加上http://

    【讨论】:

    • 好的,现在我得到:克隆到测试...致命:xxx.xxx.xxx.xxx:xxxx/repositories/Test.git/info/refs 未找到:您是否在服务器上运行了 git update-server-info?
    • @Berty:抱歉,我从未使用过 HTTP 克隆。但正如输出所示,您可能必须运行 git update-server-info?
    猜你喜欢
    • 2021-08-28
    • 1970-01-01
    • 2021-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-02
    • 1970-01-01
    • 2019-02-01
    相关资源
    最近更新 更多