目录搜索
GuidesgitattributesgiteverydaygitglossarygitignoregitmodulesgitrevisionsgittutorialgitworkflowsAdministrationgit archivegit bundlegit cleangit filter-branchgit fsckgit gcgit instawebgit reflogBasic Snapshottinggit addgit commitgit diffgit mvgit resetgit rmgit statusBranching and Merginggit branchgit checkoutgit loggit mergegit mergetoolgit stashgit tagDebugginggit bisectgit blamegit grepEmailgit amgit format-patchgit request-pullgit send-emailExternal Systemsgit fast-importgit svnGetting and Creating Projectsgit clonegit initGitgit annotategit archimportgit bisect-lk2009git check-attrgit check-mailmapgit check-ref-formatgit checkout-indexgit cherrygit citoolgit columngit credentialgit credential-cachegit credential-storegit cvsexportcommitgit cvsimportgit cvsservergit diff-filesgit diff-treegit difftoolgit fast-exportgit fetch-packgit fmt-merge-msggit get-tar-commit-idgit guigit http-backendgit http-fetchgit http-pushgit imap-sendgit index-packgit interpret-trailersgit ls-remotegit ls-treegit mailinfogit mailsplitgit merge-filegit merge-indexgit merge-one-filegit merge-treegit mktaggit mktreegit name-revgit notesgit p4git pack-objectsgit pack-redundantgit pack-refsgit parse-remotegit patch-idgit prunegit prune-packedgit quiltimportgit receive-packgit remote-extgit remote-fdgit remote-testgitgit repackgit replacegit rereregit send-packgit sh-i18ngit sh-setupgit shellgit show-branchgit show-indexgit stripspacegit unpack-filegit unpack-objectsgit upload-archivegit upload-packgit vargit verify-commitgit verify-taggit whatchangedgit worktreeInspection and Comparisongit describegit shortloggit showMiscellaneousapi credentialsapi indexgitcligitcore tutorialgitcredentialsgitcvs migrationgitdiffcoregithooksgitkgitnamespacesgitremote helpersgitrepository layoutgitsubmodulesgittutorial 2gitwebgitweb.confpack formatUser ManualPatchinggit applygit cherry-pickgit rebasegit revertPlumbing Commandsgit cat-filegit check-ignoregit commit-treegit count-objectsgit diff-indexgit for-each-refgit hash-objectgit ls-filesgit merge-basegit read-treegit rev-listgit rev-parsegit show-refgit symbolic-refgit update-indexgit update-refgit verify-packgit write-treeServer Admingit daemongit update-server-infoSetup and Configgitgit configgit helpSharing and Updating Projectsgit fetchgit pullgit pushgit remotegit submodule
文字

名称

git-credential-cache  -  Helper 临时将密码存储在内存中

概要

git config credential.helper 'cache [options]'

Description

该命令将内存中的凭证缓存供将来的 Git 程序使用。存储的凭证永远不会触及磁盘,并在可配置的超时后被遗忘。缓存可通过 Unix 域套接字进行访问,通过文件系统权限仅限于当前用户。

你可能不想直接调用这个命令;它意味着被 Git 的其他部分用作凭证助手。请参阅 gitcredentials [7]或EXAMPLES以下。

选项

--timeout <seconds>

缓存凭据的秒数(默认值:900)。

--socket <path>

使用<path>联系运行中的高速缓存守护进程(或启动一个新的高速缓存守护进程,如果未启动)。默认为$XDG_CACHE_HOME/git/credential/socket除非~/.git-credential-cache/在存在的情况下~/.git-credential-cache/socket使用。如果您的主目录位于网络安装的文件系统上,则可能需要将其更改为本地文件系统。您必须指定绝对路径。

控制daemon(守护进程)

如果您希望守护进程提前退出,并在所有缓存的凭据超时前忘记,则可以执行以下exit操作:

git credential-cache exit

示例

这个 helper 的重点是减少你输入用户名或密码的次数。例如:

$ 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]

您可以通过 credential.helper 配置变量提供选项(此示例将缓存时间降低到5分钟):

$ git config credential.helper 'cache --timeout=300'
上一篇:下一篇: