summaryrefslogtreecommitdiff
path: root/devdocs/git/git-credential-store.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-store.html
new repository
Diffstat (limited to 'devdocs/git/git-credential-store.html')
-rw-r--r--devdocs/git/git-credential-store.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/devdocs/git/git-credential-store.html b/devdocs/git/git-credential-store.html
new file mode 100644
index 00000000..72164368
--- /dev/null
+++ b/devdocs/git/git-credential-store.html
@@ -0,0 +1,13 @@
+<h1>git-credential-store</h1> <h2 id="_name">Name</h2> <div class="sectionbody"> <p>git-credential-store - Helper to store credentials on disk</p> </div> <h2 id="_synopsis">Synopsis</h2> <div class="sectionbody"> <div class="listingblock"> <div class="content"> <pre data-language="shell">git config credential.helper 'store [&lt;options&gt;]'</pre> </div> </div> </div> <h2 id="_description">Description</h2> <div class="sectionbody"> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <div class="title">Note</div> </td> <td class="content"> Using this helper will store your passwords unencrypted on disk, protected only by filesystem permissions. If this is not an acceptable security tradeoff, try <a href="git-credential-cache">git-credential-cache[1]</a>, or find a helper that integrates with secure storage provided by your operating system. </td> </tr> </table> </div> <p>This command stores credentials indefinitely on disk for use by future Git programs.</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-store.txt---fileltpathgt"> --file=&lt;path&gt; </dt> <dd> <p>Use <code>&lt;path&gt;</code> to lookup and store credentials. The file will have its filesystem permissions set to prevent other users on the system from reading it, but it will not be encrypted or otherwise protected. If not specified, credentials will be searched for from <code>~/.git-credentials</code> and <code>$XDG_CONFIG_HOME/git/credentials</code>, and credentials will be written to <code>~/.git-credentials</code> if it exists, or <code>$XDG_CONFIG_HOME/git/credentials</code> if it exists and the former does not. See also <a href="#FILES">FILES</a>.</p> </dd> </dl> </div> </div> <h2 id="FILES">Files</h2> <div class="sectionbody"> <p>If not set explicitly with <code>--file</code>, there are two files where git-credential-store will search for credentials in order of precedence:</p> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-credential-store.txt-git-credentials"> ~/.git-credentials </dt> <dd> <p>User-specific credentials file.</p> </dd> <dt class="hdlist1" id="Documentation/git-credential-store.txt-XDGCONFIGHOMEgitcredentials"> $XDG_CONFIG_HOME/git/credentials </dt> <dd> <p>Second user-specific credentials file. If <code>$XDG_CONFIG_HOME</code> is not set or empty, <code>$HOME/.config/git/credentials</code> will be used. Any credentials stored in this file will not be used if <code>~/.git-credentials</code> has a matching credential as well. It is a good idea not to create this file if you sometimes use older versions of Git that do not support it.</p> </dd> </dl> </div> <p>For credential lookups, the files are read in the order given above, with the first matching credential found taking precedence over credentials found in files further down the list.</p> <p>Credential storage will by default write to the first existing file in the list. If none of these files exist, <code>~/.git-credentials</code> will be created and written to.</p> <p>When erasing credentials, matching credentials will be erased from all files.</p> </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 store
+$ git push http://example.com/repo.git
+Username: &lt;type your username&gt;
+Password: &lt;type your password&gt;
+
+[several days later]
+$ git push http://example.com/repo.git
+[your credentials are used automatically]</pre> </div> </div> </div> <h2 id="_storage_format">Storage format</h2> <div class="sectionbody"> <p>The <code>.git-credentials</code> file is stored in plaintext. Each credential is stored on its own line as a URL like:</p> <div class="listingblock"> <div class="content"> <pre>https://user:pass@example.com</pre> </div> </div> <p>No other kinds of lines (e.g. empty lines or comment lines) are allowed in the file, even though some may be silently ignored. Do not view or edit the file with editors.</p> <p>When Git needs authentication for a particular URL context, credential-store will consider that context a pattern to match against each entry in the credentials file. If the protocol, hostname, and username (if we already have one) match, then the password is returned to Git. See the discussion of configuration in <a href="gitcredentials">gitcredentials[7]</a> for more information.</p> </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-store" class="_attribution-link">https://git-scm.com/docs/git-credential-store</a>
+ </p>
+</div>