本文介绍了无法通过http克隆git repos;找不到信息/参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to make a git repository available for read-only access over http.

我正在按照旧方式进行操作,因为git-http-backend在主机系统上不可用.也就是说,我只是将裸存储库放在http可访问的位置.

I am doing it the old-style way because git-http-backend is not available on my host system. That is, I am simply putting the bare repository in a http accessible location.

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

I created the bare repository successfully on the host using git clone --bare <some-remote-location>.

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

Now, when I point git to the new clone using git clone http://my.host.name/location, a message reports repository not found.

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

When I capture network traffic, I see that git is attempting to access http://my.host.name/location/info/refs. This would be expected to fail because there is no info/refs path in the repository. Rather there are info and refs directories directly beneath the repository root.

很明显,克隆的裸存储库的结构未达到客户端期望的结构.有人知道为什么会这样吗?

Evidently the cloned bare repository is not structured as expected by the client. Does anyone know why this might be?

推荐答案

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

You will need to run git update-server-info on the server to generate the files necessary for the "dumb protocol" to work.

这篇关于无法通过http克隆git repos;找不到信息/参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 14:21