Fatal: git-http-push failed

I had trouble pushing changes to one of my git repositories. The error message was:

Fatal: git-http-push failed

Looking at server logs

60.xxx.xxx.205 - xxx.xxx [06/Mar/2012:21:37:56 -0500] "MKCOL /git/Test.git/objects/77/ HTTP/1.1" 403 489

It appears that file permissions were the issue.

In my case, the Git repository was created using virtualmin, and the owner was www-data. CGI programs were run under suexec, where the program was executed using the file owner’s permissions. For suexec to work, the owner needs write permissions to the directories. The following was sufficient to do the trick.

sudo chmod -R u+w Test.git

Problem with HTTP Verbs
How to troubleshoot git server issues