解決github git push錯誤The requested URL returned error: 403 Forbidden while accessing


github push錯誤: 

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

git 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,彈出框輸入密碼,即可提交


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM