记录于2021-10-31
今天突然发现有个老项目提交一直报错
代码语言:javascript复制Username for 'https://github.com': 736226400@qq.com
Password for 'https://736226400@qq.com@github.com':
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/qaiu/c4droid-code.git/'
这里给了一个关于不支持密码的公告,以前没注意 https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations
解决办法: 修改项目里 .git/config 把原https://github.com/xxx/xxx.git 改为如下格式 git@github.com:xxx/xxx.git
对于新项目克隆如果要提交的话要使用 git clone git@github.com:xxx/xxx.git 不要再用原来的https了
关于如何配置ssh连接github,网上好多教程,都比较简单,这里就不详细说明了