Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't clone git repos via http; info/refs not found

Tags:

I am trying to make a git repository available for read-only access over 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.

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

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

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?

like image 353
epl Avatar asked Oct 31 '13 04:10

epl


2 Answers

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

like image 76
poke Avatar answered Oct 06 '22 00:10

poke


Try the steps mentioned here on git-scm for http/s protocol.

Basically, after doing the git clone --bare <path-to-repository>, you need to run mv hooks/post-update.sample hooks/post-update withing your bare repository and then do a git update-server-info once and then you should be able to clone the repo.

like image 23
Anshul Goyal Avatar answered Oct 05 '22 23:10

Anshul Goyal