解决git push 中remote: Permission to xxxxx.git denied to xxx. fatal: unable to access ‘https://github.com/ xxxxx.git/’: The requested URL returned error: 403
问题描述
今天我在使用git push 将修改的项目push到github中,出现:
remote: Permission to xxxxx.git denied to xxx.
fatal: unable to access ‘https://github.com/ xxxxx.git/’: > The requested URL returned error: 403
解决方案
修改.git/cofig中的url
cd 到项目中,编辑 .git/cofig中的url
vim .git/config
将
[remote “origin”]
url = https://github.com/git的用户名/项目名称
的url改为
url = https://git的用户名@github.com/git的用户名/项目名称
保存退出后:
git push [-f] -u origin master
注意: -f 参数是强推