Enabling Write access to git-http-backend

While I was able to read/clone a git repository self-hosted with HTTPD and git-http-backend, I found that I could not push to it. Here’s how I fixed it.

The directions say this:

By default, only the upload-pack service is enabled, which serves git fetch-pack and git ls-remote clients, which are invoked from git fetch, git pull, and git clone. If the client is authenticated, the receive-pack service is enabled, which serves git send-pack clients, which is invoked from git push.


It goes on to say this:

These services can be enabled/disabled using the per-repository configuration file:


It turns out is was talking about the standard git configuration file, and not something web specific. Since I created a bare repository named gitserver.repo, this file is /var/lib/git/gitserver.repo/config. I added the following content, and was then able to push:

        receivepack = true

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.