summaryrefslogtreecommitdiff
path: root/devdocs/git/git-credential-cache.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/git/git-credential-cache.html
new repository
Diffstat (limited to 'devdocs/git/git-credential-cache.html')
-rw-r--r--devdocs/git/git-credential-cache.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/devdocs/git/git-credential-cache.html b/devdocs/git/git-credential-cache.html
new file mode 100644
index 00000000..3c9312ec
--- /dev/null
+++ b/devdocs/git/git-credential-cache.html
@@ -0,0 +1,13 @@
+<h1>git-credential-cache</h1> <h2 id="_name">Name</h2> <div class="sectionbody"> <p>git-credential-cache - Helper to temporarily store passwords in memory</p> </div> <h2 id="_synopsis">Synopsis</h2> <div class="sectionbody"> <div class="listingblock"> <div class="content"> <pre data-language="shell">git config credential.helper 'cache [&lt;options&gt;]'</pre> </div> </div> </div> <h2 id="_description">Description</h2> <div class="sectionbody"> <p>This command caches credentials for use by future Git programs. The stored credentials are kept in memory of the cache-daemon process (instead of being written to a file) and are forgotten after a configurable timeout. Credentials are forgotten sooner if the cache-daemon dies, for example if the system restarts. The cache is accessible over a Unix domain socket, restricted to the current user by filesystem permissions.</p> <p>You probably don’t want to invoke this command directly; it is meant to be used as a credential helper by other parts of Git. See <a href="gitcredentials">gitcredentials[7]</a> or <code>EXAMPLES</code> below.</p> </div> <h2 id="_options">Options</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-credential-cache.txt---timeoutltsecondsgt"> --timeout &lt;seconds&gt; </dt> <dd> <p>Number of seconds to cache credentials (default: 900).</p> </dd> <dt class="hdlist1" id="Documentation/git-credential-cache.txt---socketltpathgt"> --socket &lt;path&gt; </dt> <dd> <p>Use <code>&lt;path&gt;</code> to contact a running cache daemon (or start a new cache daemon if one is not started). Defaults to <code>$XDG_CACHE_HOME/git/credential/socket</code> unless <code>~/.git-credential-cache/</code> exists in which case <code>~/.git-credential-cache/socket</code> is used instead. If your home directory is on a network-mounted filesystem, you may need to change this to a local filesystem. You must specify an absolute path.</p> </dd> </dl> </div> </div> <h2 id="_controlling_the_daemon">Controlling the daemon</h2> <div class="sectionbody"> <p>If you would like the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an <code>exit</code> action:</p> <div class="listingblock"> <div class="content"> <pre data-language="shell">git credential-cache exit</pre> </div> </div> </div> <h2 id="_examples">Examples</h2> <div class="sectionbody"> <p>The point of this helper is to reduce the number of times you must type your username or password. For example:</p> <div class="listingblock"> <div class="content"> <pre data-language="shell-session">$ git config credential.helper cache
+$ git push http://example.com/repo.git
+Username: &lt;type your username&gt;
+Password: &lt;type your password&gt;
+
+[work for 5 more minutes]
+$ git push http://example.com/repo.git
+[your credentials are used automatically]</pre> </div> </div> <p>You can provide options via the credential.helper configuration variable (this example increases the cache time to 1 hour):</p> <div class="listingblock"> <div class="content"> <pre data-language="shell-session">$ git config credential.helper 'cache --timeout=3600'</pre> </div> </div> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2012&ndash;2024 Scott Chacon and others<br>Licensed under the MIT License.<br>
+ <a href="https://git-scm.com/docs/git-credential-cache" class="_attribution-link">https://git-scm.com/docs/git-credential-cache</a>
+ </p>
+</div>