?
本文檔使用 php中文網(wǎng)手冊(cè) 發(fā)布
git-credential-cache - Helper 臨時(shí)將密碼存儲(chǔ)在內(nèi)存中
git config credential.helper 'cache [options]'
該命令將內(nèi)存中的憑證緩存供將來(lái)的 Git 程序使用。存儲(chǔ)的憑證永遠(yuǎn)不會(huì)觸及磁盤(pán),并在可配置的超時(shí)后被遺忘。緩存可通過(guò) Unix 域套接字進(jìn)行訪問(wèn),通過(guò)文件系統(tǒng)權(quán)限僅限于當(dāng)前用戶。
你可能不想直接調(diào)用這個(gè)命令;它意味著被 Git 的其他部分用作憑證助手。請(qǐng)參閱 gitcredentials [7]或EXAMPLES
以下。
--timeout <seconds>
緩存憑據(jù)的秒數(shù)(默認(rèn)值:900)。
--socket <path>
使用<path>
聯(lián)系運(yùn)行中的高速緩存守護(hù)進(jìn)程(或啟動(dòng)一個(gè)新的高速緩存守護(hù)進(jìn)程,如果未啟動(dòng))。默認(rèn)為$XDG_CACHE_HOME/git/credential/socket
除非~/.git-credential-cache/
在存在的情況下~/.git-credential-cache/socket
使用。如果您的主目錄位于網(wǎng)絡(luò)安裝的文件系統(tǒng)上,則可能需要將其更改為本地文件系統(tǒng)。您必須指定絕對(duì)路徑。
如果您希望守護(hù)進(jìn)程提前退出,并在所有緩存的憑據(jù)超時(shí)前忘記,則可以執(zhí)行以下exit
操作:
git credential-cache exit
這個(gè) helper 的重點(diǎn)是減少你輸入用戶名或密碼的次數(shù)。例如:
$ git config credential.helper cache $ git push http://example.com/repo.git Username: <type your username>Password: <type your password>[work for 5 more minutes]$ git push http://example.com/repo.git[your credentials are used automatically]
您可以通過(guò) credential.helper 配置變量提供選項(xiàng)(此示例將緩存時(shí)間降低到5分鐘):
$ git config credential.helper 'cache --timeout=300'