【问题标题】:Git update-server-info nothing dogit update-server-info 什么都不做
【发布时间】:2013-06-20 10:47:00
【问题描述】:

目标:web 服务器上托管 git 存储库,无需 git 程序和 git 守护程序(使用 HTTP 作为传输协议并转储为 git 协议 - 没有脚本,没有 shell,只有GET 支持)。

我使用的教程来自:http://git-scm.com/book/en/Git-Internals-Transfer-Protocols

步骤:

  1. 创建一个新的 git 存储库。
  2. 克隆为 --bare 到 grepo.git
  3. 在 grepo.git 中调用“git update-server-info”(没有文件更改!)
  4. mv hooks/post-commit.sample hooks/post-commit && chmod a+x hooks/post-commit
  5. 调用“git clone http://example.com/grepo.git

在客户端得到:致命:http://example.com/grepo.git/info/refs?service=git-upload-pack not found:你在服务器上运行了 git update-server-info 吗?

在请求日志中的服务器端:[20/Jun/2013:11:45:16 +0200] "GET /grepo.git/info/refs?service=git-upload-pack HTTP/1.1" 404 1385

为什么 git 调用服务器上的任何脚本? 我的 git 版本是 1.8.1.5。

【问题讨论】:

  • 服务器进程是否可以读取 git 存储库?你能提供你的网络服务器配置吗?
  • 是的,可读。例如“curlexample.com/grepo.git/HEAD”显示HEAD文件的内容(参考:refs/heads/master)。
  • 对不起。我无法提供我的网络服务器配置文件,因为这是共享网络服务器托管,我无法访问配置文件。
  • 嗯,很奇怪。 curl example.com/grepo.git/info/refs 是否正常工作(没有 ? 部分)。您可以仔细检查 info/refs 权限以查看它是否与 HEAD 文件相同。
  • 哇!谢谢!解压存档后,某些文件的组错误(不存在的用户)。更改所有文件的权限后,一切正常。

标签: git repository dump


【解决方案1】:

你可以检查 repo.git/info/refs 的权限,看看它是否可以被 web 服务器进程读取。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-08
    • 1970-01-01
    • 2016-05-27
    • 2011-04-04
    • 2017-02-07
    • 2011-04-09
    • 2019-08-16
    • 2021-06-20
    相关资源
    最近更新 更多