Search code examples
githttpcgit

How do you setup cgit with pull and push over http?


I am trying to setup a cgit instance from which you can push or pull over http. However, i am able to browse my repos over http via cgit, but when i try to push to this repo, i get an error:

Fatal, /info/refs not valid, is this a git repository?

This path exists on the server, and this is an empty file. I have created a post-update hook which executes git update-server-info automatically (the post-update.example from the repo). But when i try to view the /info/refs file via http, cgit has an announcement, that this is an empty repository.

What can i do to get access to this file via http, so i can push or pull with the urls that cgit provides to me?

I have my repos on a shared hosting provider, so i have no access to the apache.conf but only to the .htaccess files...


Solution

  • As far as I can tell, cgit doesn't enable pushing to Git repositories (from looking through their feature list).

    You'll likely need to setup something like git-http-backend to be able to push. The git-http-backend manpage has example configurations for Apache 2.x for anonymous read with authenticated write, and for authenticated read and write.