一、前言
当前github上传代码已经不能再使用用户名+密码的方式提交代码了,而改用了access token的方式提交代码到github。 github 报错如下图所示:
大概意思就是
对密码认证的支持于2021年8月13日被删除。请使用个人访问令牌代替。
二、申请Access Token
1.登录github,点击头像,选择Settings
2.选择Developer settings
3.选择Personal access tokens
4.选择General new token
5.设置生成参数
- 1.Note:描述access token的用途;
- 2.Expiretion:有效期;
- 3.Select Scopes:设置权限范围.
6.最后点击General token
7.最终到得access token
注意:保存access token
三、使用Access token
使用access token生成仓库地址(前提是需要先在github创建好仓库)
https://(your_access_token)@github.com/(your_path).git
- 1.your_access_token就是上面申请的access token;
- 2.your_path是仓库路径,例如下图,your_path = xiongjinhui/sort_algorithms:
现在就可以使用这个仓库地址提交代码到github了。