github新規 取消密碼認證解決方案


環境:

系統: window 10 pro

git: version 2.23.0.windows.1

terminal: Windows PowerShell

步驟:

1. github個人主頁里生成token

 

Setting / Developer settings / Personal access tokens

點擊生成token,如下圖

 

 

 

 

拉到最下面點擊生成即可

 

 

 

生成后記得保存好token,這個token在github中只能查看一次。

 

3. git 拉取代碼或修改已拉取代碼范例:

clone:

git clone https://[你的token]@[你的項目路徑]
----
例:
git clone https://ghp_GW2bxXRpro0DEehtIDqF5wfvCFqTCi2xxxx@github.com/bingco-zhan/notes.git

 

本地已存在項目:

git remote set-url origin https://[你的token]@[你的項目路徑]
----
例:
git remote set-url origin https://ghp_GW2bxXRpro0DEehtIDqF5wfvCFqTCi2xxxx@github.com/bingco-zhan/notes.git

git pull origin main

---------------------------------

當然了,將token當做密碼使用也是沒有問題的。只是輸入略麻煩

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM