return code 22, fatal: git-http-push-failed
我使用
仅供参考,因为在搜索" git-http-push失败的返回码22 "时,在Google上排名很高:
在服务器上使用https git和htpasswd时,似乎发送的用户名包括域:
对我来说,解决方案是在
machine host.domain.tld
login the_user_name
password the_password
尝试将其添加到裸存储库中的配置文件中:
1 2 | [http] receivepack = true |
此外,如果您使用的是https:// ...网址,则无论如何都不会使用ssh。为了使ssh url正常工作,您需要正确配置Apache服务器以调用
例如,请参阅此git-http-backend问题。
对我来说,诀窍是启用WebDAV
我将其放在LocationMatch中:
1 2 3 4 5 6 7 | <LocationMatch /git/.*\\.git> Dav On AuthType Basic AuthName"Git Verification" AuthUserFile /etc/httpd/git/test.passwd Require valid-user </LocationMatch> |
这是因为您是使用http网址而不是Github上的ssh网址进行克隆的。
现在,您正在尝试使用无法使用的ssh进行推送。
在这种情况下,git clone或git pull起作用,但git push失败。
一种解决方案是使用ssh url克隆,其格式为[email protected]:username / repo-name.git
单击"您可以使用HTTPS,SSH或Subversion \\进行克隆"消息中的SSH时,您可以在GitHub仓库上找到此URL。
然后进行更改并执行git push。确保您的机器的公共密钥在您的Github帐户中。
当前情况的另一种工作方式是在执行Git推送时提供用户名和密码。