remote: Support for password authentication was removed
周末提交代码,把代码push到github上,控制台报了下面的错误:
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
表示远程推送不再支持密码验证了,改成 token 验证了。
解决方案
- 首先要生成token,在 github 上找到setting -> Developer settings ->Personal access tokens->Generate new token
在配置页面配置好权限后,即可生成token,注意这里需要保存好token,因为只显示一次。
- 设置token,这里分成两种情况,代码已经有的,远程仓库地址添加token;没有代码的,在git clone添加token
- 修改远程仓库添加token
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
- git clone 添加token
git clone https://<your_token>@github.com/<USERNAME>/<REPO>.git
添加好token就可以推送和下拉代码了。
遇到的坑
- 在idea上的github上设置token没效果,这个具体原因未知
- 网上一大堆介绍如果生成token,但是重点是第二步,添加或者更新token。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?