Skip to content

Commit 1980f6a

Browse files
committed
docs: discuss caching personal access tokens
Describe problems storing personal access tokens in git-credential-cache and suggest alternatives. Research suggests that many users are confused about this: > the point of passwords is that (ideally) you memorise them [so] > they're never stored anywhere in plain text. Yet GitHub's personal > access token system seems to basically force you to store the token in > plain text? https://stackoverflow.com/questions/46645843/where-to-store-my-git-personal-access-token#comment89963004_46645843 Signed-off-by: M Hickford <[email protected]>
1 parent 1465006 commit 1980f6a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Documentation/git-credential-cache.txt

+17
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,23 @@ variable (this example increases the cache time to 1 hour):
7878
$ git config credential.helper 'cache --timeout=3600'
7979
-------------------------------------------------------
8080

81+
PERSONAL ACCESS TOKENS
82+
----------------------
83+
84+
Some remotes accept personal access tokens, which are randomly
85+
generated and hard to memorise. They typically have a lifetime of weeks
86+
or months.
87+
88+
git-credential-cache is inherently unsuitable for persistent storage of
89+
personal access tokens. The credential will be forgotten after the cache
90+
timeout. Even if you configure a long timeout, credentials will be
91+
forgotten if the daemon dies.
92+
93+
To avoid frequently regenerating personal access tokens, configure a
94+
credential helper with persistent storage. Alternatively, configure an
95+
OAuth credential helper to generate credentials automatically. See
96+
linkgit:gitcredentials[7].
97+
8198
GIT
8299
---
83100
Part of the linkgit:git[1] suite

0 commit comments

Comments
 (0)