导航

git push 403的解决方法

Posted on 2012-07-28 10:59  eastson  阅读(9287)  评论(0编辑  收藏  举报

创建一个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有关的一些文档: