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

posted @ 2021-08-16 00:43  anynw  阅读(1052)  评论(0)    收藏  举报