问题描述
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.
不再支持密码,只支持 personal access token 了。
解决
先生成一个 personal access token
https://github.com/settings/tokens/new
生成一个 token
macOS 环境下配置
打开 钥匙串访问
-> 本地项目 -> 搜索钥匙串 -> 输入 github
把原来的 password 改为 生成的 token。如下图:
Linux 环境下配置
[root@ip-172-30-69-214 ~]# git clone https://github.com/stardustman/repo
Cloning into 'repo'...
Username for 'https://github.com': stardustman
Password for 'https://stardustman@github.com': ; 这里输入生成的 personal access Token
remote: Enumerating objects: 3125, done.
remote: Counting objects: 100% (834/834), done.
remote: Compressing objects: 100% (187/187), done.
remote: Total 3125 (delta 742), reused 725 (delta 645), pack-reused 2291
Receiving objects: 100% (3125/3125), 373.43 KiB | 26.00 KiB/s, done.
Resolving deltas: 100% (2135/2135), done.
[root@ip-172-30-69-214 ~]# git config --global credential.helper cache ; 2 缓存