1. 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/cofig中的url

cd 到项目中,编辑 .git/cofig中的url

  1. vim .git/config

  1. [remote "origin"]
  2. url = https://github.com/git的用户名/项目名称 的url改为
  3. url = https://git的用户名@github.com/git的用户名/项目名称

保存退出后:

  1. git push [-f] -u origin master

注意: -f 参数是强推

分类: web

标签:   git   github