问题描述
Github clone 代码时候提示 remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
git clone https://github.com/XuTingSummer/tingsummer.git
正克隆到 'tingsummer'...
Username for 'https://github.com': xutingsummer@163.com
Password for 'https://xutingsummer@163.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: 'https://github.com/XuTingSummer/tingsummer.git/' 鉴权失败
原因分析:
Beginning August 13, 2021, we will no longer accept account passwords when authenticating Git operations and will require the use of token-based authentication, such as a personal access token (for developers) or an OAuth or GitHub App installation token (for integrators) for all authenticated Git operations on GitHub.com. You may also continue using SSH keys where you prefer.
参考链接:Token authentication requirements for Git operations
换句话说就是使用Token来代替密码 进行身份验证
解决方案:
Github > 个人设置 > Settings > Developer setttings > Personal access tokens > Generate new token > 根据需要勾选权限 > Generate token > 复制生成的token > 回到命令行在提示输入密码的时候输入复制好的Token
- 个人设置 > Settings
- Developer setttings
- Personal access tokens > Generate new token
- 根据需要勾选权限(个人的话全勾上就好了) > Generate token > 复制生成的token
- 回到命令行在提示输入密码的时候输入复制好的Token
git clone https://github.com/XuTingSummer/tingsummer.git
正克隆到 'tingsummer'...
Username for 'https://github.com': xutingsummer@163.com
Password for 'https://xutingsummer@163.com@github.com': #输入复制的token
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
接收对象中: 100% (4/4), 完成.