不能通过http克隆git repos; info/refs not found

epl*_*epl 21 git clone http repository git-bare

我试图使git存储库可用于通过http进行只读访问.

我这样做是旧式的,因为git-http-backend我的主机系统不可用.也就是说,我只是将裸存储库放在http可访问的位置.

我使用在主机上成功创建了裸存储库git clone --bare <some-remote-location>.

现在,当我使用git指向新克隆时git clone http://my.host.name/location,会显示一条消息repository not found.

当我捕获网络流量时,我看到git正在尝试访问http://my.host.name/location/info/refs.由于info/refs存储库中没有路径,因此预计会失败.而是存储库根目录下的inforefs目录.

显然,克隆的裸存储库的结构不符合客户的预期.有谁知道为什么会这样?

pok*_*oke 26

您需要git update-server-info在服务器上运行以生成"哑协议"工作所需的文件.

  • 此外,您需要在裸仓库中执行此操作 (3认同)

mu *_*u 無 10

尝试使用git-scm中提到的步骤来获取http/s协议.

基本上,在执行之后git clone --bare <path-to-repository>,您需要运行mv hooks/post-update.sample hooks/post-update您的裸存储库,然后执行git update-server-info一次然后您应该能够克隆存储库.