解决git push 中remote: Permission to xxxxx.git denied to xxx. fatal: unable to access 'https://github.com/ xxxxx.git/':URL .......

问题:

使用git push -u origin master 命令时 出现 :

remote: Permission to xxxxx.git denied to xxx.

fatal: unable to access 'https://github.com/ xxxxx.git/':URL .......

解决:

1. 已经 git init 初始化,文件夹中会有.git文件,如果已经git init 没有看到 .git 文件,

点 查看 勾选 隐藏的项目:

打开.git文件中的config文件,编辑 .git/config中的url:

将config中的url中的

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

改为:

2. 改完之后:git push -u origin master

原文地址:https://www.cnblogs.com/angel648/p/13366030.html