在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’