blob: 693dd9d9d760fe2a113d4e15ab7816f34b2cd47d [file] [log] [blame]
Junio C Hamano0df92712011-12-21 22:30:441git-credential-store(1)
2=======================
3
4NAME
5----
Junio C Hamanod0316112012-08-22 19:55:296git-credential-store - Helper to store credentials on disk
Junio C Hamano0df92712011-12-21 22:30:447
8SYNOPSIS
9--------
10-------------------
Junio C Hamanoc9cb5172018-06-01 07:13:4411git config credential.helper 'store [<options>]'
Junio C Hamano0df92712011-12-21 22:30:4412-------------------
13
14DESCRIPTION
15-----------
16
17NOTE: Using this helper will store your passwords unencrypted on disk,
18protected only by filesystem permissions. If this is not an acceptable
19security tradeoff, try linkgit:git-credential-cache[1], or find a helper
20that integrates with secure storage provided by your operating system.
21
22This command stores credentials indefinitely on disk for use by future
Junio C Hamano076ffcc2013-02-06 05:13:2123Git programs.
Junio C Hamano0df92712011-12-21 22:30:4424
25You probably don't want to invoke this command directly; it is meant to
26be used as a credential helper by other parts of git. See
27linkgit:gitcredentials[7] or `EXAMPLES` below.
28
29OPTIONS
30-------
31
Junio C Hamanod701ba32014-11-06 23:18:0532--file=<path>::
Junio C Hamano0df92712011-12-21 22:30:4433
Junio C Hamano4cc4a842015-05-11 22:41:0234Use `<path>` to lookup and store credentials. The file will have its
Junio C Hamano0df92712011-12-21 22:30:4435filesystem permissions set to prevent other users on the system
36from reading it, but will not be encrypted or otherwise
Junio C Hamano4cc4a842015-05-11 22:41:0237protected. If not specified, credentials will be searched for from
38`~/.git-credentials` and `$XDG_CONFIG_HOME/git/credentials`, and
39credentials will be written to `~/.git-credentials` if it exists, or
40`$XDG_CONFIG_HOME/git/credentials` if it exists and the former does
41not. See also <<FILES>>.
42
43[[FILES]]
44FILES
45-----
46
Junio C Hamano92d80372016-07-13 22:00:0547If not set explicitly with `--file`, there are two files where
Junio C Hamano4cc4a842015-05-11 22:41:0248git-credential-store will search for credentials in order of precedence:
49
50~/.git-credentials::
51User-specific credentials file.
52
53$XDG_CONFIG_HOME/git/credentials::
54Second user-specific credentials file. If '$XDG_CONFIG_HOME' is not set
55or empty, `$HOME/.config/git/credentials` will be used. Any credentials
56stored in this file will not be used if `~/.git-credentials` has a
57matching credential as well. It is a good idea not to create this file
58if you sometimes use older versions of Git that do not support it.
59
60For credential lookups, the files are read in the order given above, with the
61first matching credential found taking precedence over credentials found in
62files further down the list.
63
64Credential storage will by default write to the first existing file in the
65list. If none of these files exist, `~/.git-credentials` will be created and
66written to.
67
68When erasing credentials, matching credentials will be erased from all files.
Junio C Hamano0df92712011-12-21 22:30:4469
70EXAMPLES
71--------
72
73The point of this helper is to reduce the number of times you must type
74your username or password. For example:
75
76------------------------------------------
77$ git config credential.helper store
78$ git push http://example.com/repo.git
79Username: <type your username>
80Password: <type your password>
81
82[several days later]
83$ git push http://example.com/repo.git
84[your credentials are used automatically]
85------------------------------------------
86
87STORAGE FORMAT
88--------------
89
90The `.git-credentials` file is stored in plaintext. Each credential is
91stored on its own line as a URL like:
92
93------------------------------
94https://user:pass@example.com
95------------------------------
96
Junio C Hamano076ffcc2013-02-06 05:13:2197When Git needs authentication for a particular URL context,
Junio C Hamano0df92712011-12-21 22:30:4498credential-store will consider that context a pattern to match against
99each entry in the credentials file. If the protocol, hostname, and
100username (if we already have one) match, then the password is returned
Junio C Hamano076ffcc2013-02-06 05:13:21101to Git. See the discussion of configuration in linkgit:gitcredentials[7]
Junio C Hamano0df92712011-12-21 22:30:44102for more information.
103
104GIT
105---
106Part of the linkgit:git[1] suite