git push 403的解决方法


创建一个GitHub.com项目,Push时总是提示403错误:

[amonest@localhost ~]$ git config --global user.name amonest
[amonest@localhost ~]$ git config --global user.email xxx@xxx.com

[amonest@localhost ~]$ git clone https://github.com/amonest/python-scripts.git
[amonest@localhost ~]$ cd python-scripts

... 省略中间代码修改过程 ...

[amonest@localhost python-scripts]$ git remote add orginal https://github.com/amonest/python-scripts.git
[amonest@localhost python-scripts]$ git push orginal master
error: The requested URL returned error: 403 while accessing https://github.com/amonest/python-scripts.git/info/refs

fatal: HTTP request failed

 

网上搜索了半天,终于找到解决方法:《Pushing to Git returning Error Code 403 fatal: HTTP request failed

[amonest@localhost python-scripts]$ git remote set-url orginal https://amonest@github.com/amonest/python-scripts.git
[amonest@localhost python-scripts]$ git push orginal master

稍等一下就会提示输入密码:

 

这样就OK了。

 

与Git有关的一些文档:


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM