Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up git via WebDAV, the idea is to host it on my NAS where I cannot install any software, so I can't really use smarter transports.

Now clone works, but push does not: I get "http-push-failed" with the error code 22 - I googled that and all I found is that I have to enable webdav to allow for pushing but it is already enabled(I can mount it on windows and then work on it, but I would prefer to push directly to it).

I did run git update-server-info and I'm trying it in a local network.

The command I tried is

git push http://username:password@domain/share/.git master 

(I also tried https)

share|improve this question

Once you've done git update-server-info you need to restart apache with service apache2 restart.

If you continue having the same error edit the file .git/config into your client repository and modify the "url" line of [remote "origin"] like this:

url = http://username:password@domain/and/repository.git

If this doesn't resolve the problem it's probably it will be a wrong permission's set in the folder you have your repository or your project. All the files (include the project's file like project1.git) should have the owner www-data (eg: chown -R www-data:www-data /var/www/repository)

This three tips solved my problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.