运行以下命令后:
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>
答案 0 :(得分:1)
检查您是否没有可能覆盖您的登录名/密码的凭证助手:
git config credential.helper
使用最终的'/'
尝试相同的远程网址git remote set-url origin https://github.com/<UserName>/<repo-name>.git