git記住用戶名和密碼適用於git bash 和碼雲


HOME目錄中,一般為C:\users\Administrator,也可以是你自己創建的系統用戶名目錄,反正都在C:\users***中。

創建.git-credentials文件。

使用git bash 輸入下面命令行即可創建

touch .git-credentials

創建完成后,

如果是github在該文件中輸入:

https://username:password@github.com

如果是碼雲的為:

https://username:password@gitee.com

注:username對應你的用戶名,password對應你的密碼

 

然后再進入git bash中輸入下面命令行

git config --global credential.helper store

store為永久存儲,當然也可以設置臨時的

git config –global credential.helper cache

默認為15分鍾,如果想設置保存時間的話,可以輸入:

git config credential.helper ‘cache –timeout=3600’

  

 


免責聲明!

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



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