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