Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/Documentation/git-credential-store.adoc # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / Documentation / git-credential-store.adoc` 111 lines ยท 3663 bytes Raw Blame History 1 git-credential-store(1) 2 ======================= 3 4 NAME 5 ---- 6 git-credential-store - Helper to store credentials on disk 7 8 SYNOPSIS 9 -------- 10 ------------------- 11 git config credential.helper 'store []' 12 ------------------- 13 14 DESCRIPTION 15 ----------- 16 17 NOTE: Using this helper will store your passwords unencrypted on disk, 18 protected only by filesystem permissions. If this is not an acceptable 19 security tradeoff, try linkgit:git-credential-cache[1], or find a helper 20 that integrates with secure storage provided by your operating system. 21 22 This command stores credentials indefinitely on disk for use by future 23 Git programs. 24 25 You probably don't want to invoke this command directly; it is meant to 26 be used as a credential helper by other parts of git. See 27 linkgit:gitcredentials[7] or <> below. 28 29 OPTIONS 30 ------- 31 32 --file=:: 33 34 Use `` to lookup and store credentials. The file will have its 35 filesystem permissions set to prevent other users on the system 36 from reading it, but it will not be encrypted or otherwise 37 protected. If not specified, credentials will be searched for from 38 `~/.git-credentials` and `$XDG_CONFIG_HOME/git/credentials`, and 39 credentials will be written to `~/.git-credentials` if it exists, or 40 `$XDG_CONFIG_HOME/git/credentials` if it exists and the former does 41 not. See also <>. 42 43 [[FILES]] 44 FILES 45 ----- 46 47 If not set explicitly with `--file`, there are two files where 48 git-credential-store will search for credentials in order of precedence: 49 50 ~/.git-credentials:: 51 User-specific credentials file. 52 53 $XDG_CONFIG_HOME/git/credentials:: 54 Second user-specific credentials file. If '$XDG_CONFIG_HOME' is not set 55 or empty, `$HOME/.config/git/credentials` will be used. Any credentials 56 stored in this file will not be used if `~/.git-credentials` has a 57 matching credential as well. It is a good idea not to create this file 58 if you sometimes use older versions of Git that do not support it. 59 60 For credential lookups, the files are read in the order given above, with the 61 first matching credential found taking precedence over credentials found in 62 files further down the list. 63 64 Credential storage will by default write to the first existing file in the 65 list. If none of these files exist, `~/.git-credentials` will be created and 66 written to. 67 68 When erasing credentials, matching credentials will be erased from all files. 69 70 [[EXAMPLES]] 71 EXAMPLES 72 -------- 73 74 The point of this helper is to reduce the number of times you must type 75 your username or password. For example: 76 77 ------------------------------------------ 78 $ git config credential.helper store 79 $ git push http://example.com/repo.git 80 Username: 81 Password: 82 83 [several days later] 84 $ git push http://example.com/repo.git 85 [your credentials are used automatically] 86 ------------------------------------------ 87 88 STORAGE FORMAT 89 -------------- 90 91 The `.git-credentials` file is stored in plaintext. Each credential is 92 stored on its own line as a URL like: 93 94 ------------------------------ 95 https://user:pass@example.com 96 ------------------------------ 97 98 No other kinds of lines (e.g. empty lines or comment lines) are 99 allowed in the file, even though some may be silently ignored. Do 100 not view or edit the file with editors. 101 102 When Git needs authentication for a particular URL context, 103 credential-store will consider that context a pattern to match against 104 each entry in the credentials file. If the protocol, hostname, and 105 username (if we already have one) match, then the password is returned 106 to Git. See the discussion of configuration in linkgit:gitcredentials[7] 107 for more information. 108 109 GIT 110 --- 111 Part of the linkgit:git[1] suite