I made my own git repo on my server using git init --bare
. I added some files there and then cloned my repo from myserver by git clone http://www.example.
Just for the record, because this comes up high on google when searching "git-http-push failed return code 22":
With https git and htpasswd on the server, it seems that the user name sent includes the domain: user@domain.tld
, but the expected name is only user
.
The solution for me was to add this in ~/.netrc
:
machine host.domain.tld
login the_user_name
password the_password