git提交代码强制Token


如果你最近使用git提交代码时,报错 类似 2021年8月13号 authentication 认证被移除了,Please use a personal access token instead.

说明以前的用户名密码提交代码的认证方式不可用了,坑啊,搞半天…………

清除用户名密码配置:

git config --system --unset credential.helper

使用Token方法:

#github官网生成自己仓库的Token
git clone https://$token@github.com/$user/$repo.git
#然后就可以正常操作了
git init 
git add .
git commit -m ''
#现在默认分支main
git push origin main

详情配置可见:https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM