interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / Documentation / git-credential-cache.adoc

101 lines · 3224 bytes Raw Blame History
1git-credential-cache(1)
2=======================
3
4NAME
5----
6git-credential-cache - Helper to temporarily store passwords in memory
7
8SYNOPSIS
9--------
10-----------------------------
11git config credential.helper 'cache [<options>]'
12-----------------------------
13
14DESCRIPTION
15-----------
16
17This command caches credentials for use by future Git programs.
18The stored credentials are kept in memory of the cache-daemon
19process (instead of being written to a file) and are forgotten after a
20configurable timeout. Credentials are forgotten sooner if the
21cache-daemon dies, for example if the system restarts. The cache
22is accessible over a Unix domain socket, restricted to the current
23user by filesystem permissions.
24
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,`EXAMPLES`>> below.
28
29OPTIONS
30-------
31
32--timeout <seconds>::
33
34 Number of seconds to cache credentials (default: 900).
35
36--socket <path>::
37
38 Use `<path>` to contact a running cache daemon (or start a new
39 cache daemon if one is not started).
40 Defaults to `$XDG_CACHE_HOME/git/credential/socket` unless
41 `~/.git-credential-cache/` exists in which case
42 `~/.git-credential-cache/socket` is used instead.
43 If your home directory is on a network-mounted filesystem, you
44 may need to change this to a local filesystem. You must specify
45 an absolute path.
46
47CONTROLLING THE DAEMON
48----------------------
49
50If you would like the daemon to exit early, forgetting all cached
51credentials before their timeout, you can issue an `exit` action:
52
53--------------------------------------
54git credential-cache exit
55--------------------------------------
56
57[[EXAMPLES]]
58EXAMPLES
59--------
60
61The point of this helper is to reduce the number of times you must type
62your username or password. For example:
63
64------------------------------------
65$ git config credential.helper cache
66$ git push http://example.com/repo.git
67Username: <type your username>
68Password: <type your password>
69
70[work for 5 more minutes]
71$ git push http://example.com/repo.git
72[your credentials are used automatically]
73------------------------------------
74
75You can provide options via the credential.helper configuration
76variable (this example increases the cache time to 1 hour):
77
78-------------------------------------------------------
79$ git config credential.helper 'cache --timeout=3600'
80-------------------------------------------------------
81
82PERSONAL ACCESS TOKENS
83----------------------
84
85Some remotes accept personal access tokens, which are randomly
86generated and hard to memorise. They typically have a lifetime of weeks
87or months.
88
89git-credential-cache is inherently unsuitable for persistent storage of
90personal access tokens. The credential will be forgotten after the cache
91timeout. Even if you configure a long timeout, credentials will be
92forgotten if the daemon dies.
93
94To avoid frequently regenerating personal access tokens, configure a
95credential helper with persistent storage. Alternatively, configure an
96OAuth credential helper to generate credentials automatically. See
97linkgit:gitcredentials[7], sections "Available helpers" and "OAuth".
98
99GIT
100---
101Part of the linkgit:git[1] suite