cache:
git-credential-cache
是 Git 內建的一部分,用於將憑證暫時保存到內存中。timeout
參數來更改這段時間。# 保存 1 小時
git config --global credential.helper 'cache --timeout=3600'
#想要清除暫存,可使用以下指令
git config --global credential.helper exit
store:
git-credential-store
也是 Git 的內建功能,憑證會被永久保存在本地磁碟上的文件中(例如 ~/.git-credentials
),而且是以明文的方式存儲。store
,可以手動刪除 ~/.git-credentials
文件以刪除 store 功能git config --global credential.helper store
manager-core【推薦!!】:
manager-core
(Git Credential Manager Core)最初是由 Microsoft 開發的,旨在提供一個更安全且跨平台的憑證管理方式。後來,GCM Core 逐漸成為 Git 的標準憑證助手之一。manager-core
利用操作系統自帶的密碼管理功能來保護憑證,例如:
libsecret
。libsecret
git config --global credential.helper manager-core