remote:匿名访问<username> / <repo-name> .git被拒绝。致命:'https://github.com/<username>/<repo-name>.git/'的身份验证失败

时间:2018-05-12 09:42:08

标签: git github version-control

运行以下命令后:

git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/<UserName>/<repo-name>.git/
git push -u origin master
Username for 'https://github.com': <User-Name>
Password for 'https://<User-Name>@github.com':

输入正确的凭据后,我收到以下错误:

remote: Anonymous access to <UserName>/<repo-name>.git denied. 
fatal:  Authentication failed for 'https://github.com/<UserName>/<repo-
name>.git/'

任何想法为何会发生这种情况以及如何处理它?<​​/ p>

1 个答案:

答案 0 :(得分:1)

检查您是否没有可能覆盖您的登录名/密码的凭证助手:

git config credential.helper

使用最终的'/'

尝试相同的远程网址
git remote set-url origin  https://github.com/<UserName>/<repo-name>.git