原本 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 Windows Credential Manager

就再於 git push 時輸入一次帳密,下次就不用再輸入了

Git Windows Credential Manager

 

 

Related posts 相關文章
最近要小心 GitHub 上的 POC 庫,可能是惡意程式
More...
下載 GitHub 上某個目錄
More...
gitlab 出現 cannot unblock ldap blocked users 問題
More...
git 改密碼
More...

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。