Git update-server-info nothing do

2019-08-30 12:10发布

问题:

Goal: hosting git repository on web server without git program and git deamon (used HTTP as transfer protocol and dump as git protocol - nothing scripts, nothing shell, only GET supported).

I used tutorial from: http://git-scm.com/book/en/Git-Internals-Transfer-Protocols

Steps:

  1. Create a new git repo.
  2. Clone as --bare to grepo.git
  3. call "git update-server-info" in grepo.git (nothing file change!)
  4. mv hooks/post-commit.sample hooks/post-commit && chmod a+x hooks/post-commit
  5. call "git clone http:// example.com/grepo.git

On client side got: fatal: http:// example.com/grepo.git/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?

On server side in request log: [20/Jun/2013:11:45:16 +0200] "GET /grepo.git/info/refs?service=git-upload-pack HTTP/1.1" 404 1385

Why git call any script on server? My git version is 1.8.1.5.

回答1:

You may check repo.git/info/refs permissions to see if it is readable by web server process.