解决github git push错误The requested URL returned error: 403 Forbidden while accessing

it2022-05-09  55

github push错误: 

git push error: The requested URL returned error: 403 Forbidden while accessing https://github.com/wangz/future.git/info/refsgit version 1.7.1

OS:CENTOS

解决方案:

vim .git/config

在你的当前目录里面有一个隐藏文件.git(前面有一点),这个里面有个config文件,里面有一个url的值,需要把github.com这域名前面的字母改成你的名字

修改 

[remote "origin"] url = https://github.com/wangz/example.git为:[remote "origin"] url = https://wangz@github.com/wangz/example.git红色部分改成你注册github时的名字就可以了。

再次git push,弹出框输入密码,即可提交

转载于:https://www.cnblogs.com/chunshu/p/5293663.html


最新回复(0)