Error 401 when pushing to Git (GitLab)

谁说胖子不能爱 提交于 2019-12-22 09:23:19

问题


I am getting the error

Total 4 (delta 2), reused 0 (delta 0)
error: RPC failed; result=22, HTTP code = 401

When pushing to a git repository on GitLab.

It used to work.


回答1:


I had the same issue: public repos don't force git to authenticate on the first request, and git doesn't offer authentication (at least as of version 1.7.9) on subsequent requests of the same push.

This pull request for GitLab should fix it; tested on GitLab 6.3 but it may apply fine on older versions too (please let me know if it fails along with the version string).

https://github.com/gitlabhq/gitlabhq/pull/5760




回答2:


After some debugging I realized that I recently activated "Public clone access" on the project. The remote URL is an http:// URL.

Error 401 simply means "access denied" - so even the account is stored in my system, git tries to push without account information which causes this error.




回答3:


On my CentOS 6.5, git 1.7.1 I encountered the same problem, I update git to 1.7.6.1 solved this.

See How to install git using git:

http://akyl.net/how-install-latest-version-git-centos-6x



来源:https://stackoverflow.com/questions/17169252/error-401-when-pushing-to-git-gitlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!