在命令行中以GitHub发起推送或进行任何其他操作(通过https,而非ssh),如果需要输入用户名和密码,不仅会失败,而且在失败时会返回
Username for 'https://github.com': username
Password for 'https://username@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/username/repository.git/'
我没有一个@github.com
的地址。密码和用户名都是正确的。
我知道我可以切换到SSH并使用密钥,但这并不能解释为什么通过https身份验证失败。