github
- 推送到github 远程仓库的时候报下面错误
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/wJiaLiang/pythonBasics.git/'
是因为自从 21 年 8 月 13 后不再支持用户名密码的方式验证,需要创建个人访问令牌(personal access token)。
解决办法如下:
在 GitHub 上生成令牌,对应仓库中设置
1.点击 settings
2.点击右侧的 Developer settings
3.点击 Personal access tokens(个人访问令牌) 选择 tokens (classic)
4.点击 Generate new token
5.设置 token 信息
6.根据所需过期时间,建议设置成永远,以免麻烦,建议所有选项都选上
7.点击 Generate token 生成令牌 复制生成的令牌
8.修改现有的 url
git remote set-url origin https://<your_token>@github.com/<userName>/<project>.git
将<your_token>换成你自己得到的令牌。<userName>是你自己github的用户名,<project>是你的项目名称
在sourceTree中设置
1. 设置 菜单
2. 选择远程仓库地址设置为 https://your_token@github.com/userName/project.git 即可