原本 Git 支援 store 將帳密存在 User/cross/.git-credentials
但它是明碼的 (很危險)
https://cross:123456@git.cross.dev
我們可以用 microsoft/Git-Credential-Manager-for-Windows
Secure Git credential storage for Windows with support for Visual Studio Team Services, GitHub, and Bitbucket multi-factor authentication.
到 https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases 下載 GCMW-1.20.0.exe 安裝 (不用再作其它事情)
然後設定 credential.helper 為 manager
git config --global credential.helper manager
當要 push 有可能會出現錯誤,如果是這樣就要先到 控制台\所有控制台項目\認證管理員,刪除舊的被儲存的認證
remote: HTTP Basic: Access denied fatal: Authentication failed for 'https://git.cross.dev/project/cross-dev.git/'
就再於 git push 時輸入一次帳密,下次就不用再輸入了
留言