195 lines
5.0 KiB
HTML
195 lines
5.0 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of GIT-CREDENTIAL-STO</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>GIT-CREDENTIAL-STO</H1>
|
|
Section: Git Manual (1)<BR>Updated: 03/04/2021<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
git-credential-store - Helper to store credentials on disk
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
<PRE>
|
|
git config credential.helper 'store [<options>]'
|
|
</PRE>
|
|
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
|
|
|
|
<DL COMPACT><DT id="1"><DD>
|
|
|
|
|
|
|
|
<BR>
|
|
|
|
<FONT SIZE="+1">
|
|
<B>Note</B>
|
|
</FONT>
|
|
<BR>
|
|
|
|
<P>
|
|
Using this helper will store your passwords unencrypted on disk, protected only by filesystem permissions. If this is not an acceptable security tradeoff, try <B><A HREF="/cgi-bin/man/man2html?1+git-credential-cache">git-credential-cache</A></B>(1), or find a helper that integrates with secure storage provided by your operating system.
|
|
<P>
|
|
</DL>
|
|
|
|
<P>
|
|
This command stores credentials indefinitely on disk for use by future Git programs.
|
|
<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 <B><A HREF="/cgi-bin/man/man2html?7+gitcredentials">gitcredentials</A></B>(7) or <B>EXAMPLES</B> below.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<P>
|
|
|
|
--file=<path>
|
|
<DL COMPACT><DT id="2"><DD>
|
|
Use
|
|
<B><path></B>
|
|
to lookup and store credentials. The file will have its filesystem permissions set to prevent other users on the system from reading it, but will not be encrypted or otherwise protected. If not specified, credentials will be searched for from
|
|
<B>~/.git-credentials</B>
|
|
and
|
|
<B>$XDG_CONFIG_HOME/git/credentials</B>, and credentials will be written to
|
|
<B>~/.git-credentials</B>
|
|
if it exists, or
|
|
<B>$XDG_CONFIG_HOME/git/credentials</B>
|
|
if it exists and the former does not. See also
|
|
the section called "FILES".
|
|
</DL>
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
<P>
|
|
If not set explicitly with <B>--file</B>, there are two files where git-credential-store will search for credentials in order of precedence:
|
|
<P>
|
|
|
|
~/.git-credentials
|
|
<DL COMPACT><DT id="3"><DD>
|
|
User-specific credentials file.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
$XDG_CONFIG_HOME/git/credentials
|
|
<DL COMPACT><DT id="4"><DD>
|
|
Second user-specific credentials file. If
|
|
<I>$XDG_CONFIG_HOME</I>
|
|
is not set or empty,
|
|
<B>$HOME/.config/git/credentials</B>
|
|
will be used. Any credentials stored in this file will not be used if
|
|
<B>~/.git-credentials</B>
|
|
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.
|
|
</DL>
|
|
|
|
<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>
|
|
Credential storage will by default write to the first existing file in the list. If none of these files exist, <B>~/.git-credentials</B> will be created and written to.
|
|
<P>
|
|
When erasing credentials, matching credentials will be erased from all files.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
<P>
|
|
The point of this helper is to reduce the number of times you must type your username or password. For example:
|
|
<P>
|
|
<DL COMPACT><DT id="5"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
$ git config credential.helper store
|
|
$ git push <A HREF="http://example.com/repo.git">http://example.com/repo.git</A>
|
|
Username: <type your username>
|
|
Password: <type your password>
|
|
|
|
[several days later]
|
|
$ git push <A HREF="http://example.com/repo.git">http://example.com/repo.git</A>
|
|
[your credentials are used automatically]
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>STORAGE FORMAT</H2>
|
|
|
|
<P>
|
|
The <B>.git-credentials</B> file is stored in plaintext. Each credential is stored on its own line as a URL like:
|
|
<P>
|
|
<DL COMPACT><DT id="6"><DD>
|
|
|
|
|
|
|
|
<PRE>
|
|
<A HREF="https://user:pass@example.com">https://user:pass@example.com</A>
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
<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 <B><A HREF="/cgi-bin/man/man2html?7+gitcredentials">gitcredentials</A></B>(7) for more information.
|
|
<A NAME="lbAI"> </A>
|
|
<H2>GIT</H2>
|
|
|
|
<P>
|
|
Part of the <B><A HREF="/cgi-bin/man/man2html?1+git">git</A></B>(1) suite
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="7"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="8"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="9"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="10"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="11"><A HREF="#lbAF">FILES</A><DD>
|
|
<DT id="12"><A HREF="#lbAG">EXAMPLES</A><DD>
|
|
<DT id="13"><A HREF="#lbAH">STORAGE FORMAT</A><DD>
|
|
<DT id="14"><A HREF="#lbAI">GIT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:13 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|