You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,10 @@
2
2
3
3
# pass-git-helper
4
4
5
-
A [git] credential helper implementation that allows using [pass] as the credential backend for your git repositories.
6
-
This is achieved by explicitly defining mappings between hosts and entries in the password store.
5
+
A [git] credential helper implementation that allows using [pass] as the credential backend for your https-based git repositories.
6
+
When [git] tries to interact with an https-based upstream and needs credentials, this helper will be called to look up the credentials from the user's password store.
7
+
Instead of enforcing a specific layout of the password store, a configuration file with explicitly defining mappings between hosts and entries in the password store is used, giving full flexibility to the user on how to structure or reuse existing password databases for [git] authentication.
8
+
pass-git-helper will use the mappings to find the correct entry in the user's password store based on the request URL and then provides [git] with the credentials from this entry.
7
9
8
10
## Preconditions
9
11
@@ -50,7 +52,7 @@ virtualenv /your/env
50
52
## Usage
51
53
52
54
Create the file `~/.config/pass-git-helper/git-pass-mapping.ini`.
53
-
This file uses ini syntax to specify the mapping of hosts to entries in the passwordstore database.
55
+
This file uses ini syntax to specify the mapping of hosts to entries in the password store database.
54
56
Section headers define patterns which are matched against the host part of a URL with a git repository.
55
57
Matching supports wildcards (using the python [fnmatch module](https://docs.python.org/3.7/library/fnmatch.html)).
56
58
Each section needs to contain a `target` entry pointing to the entry in the password store with the password (and optionally username) to use.
@@ -103,7 +105,7 @@ This is especially helpful for wildcard matches:
103
105
target=git-logins/${host}
104
106
```
105
107
106
-
The above configuration directive will lead to any host that did not match any previous section in the ini file to being looked up under the `git-logins` directory in your passwordstore.
108
+
The above configuration directive will lead to any host that did not match any previous section in the ini file to being looked up under the `git-logins` directory in your password store.
107
109
108
110
Using the `includeIf` directive available in git >= 2.13, it is also possible to perform matching based on the current working directory by invoking `pass-git-helper` with a conditional `MAPPING-FILE`.
109
111
To achieve this, edit your `.gitconfig`, e.g. like this:
@@ -115,7 +117,7 @@ To achieve this, edit your `.gitconfig`, e.g. like this:
115
117
path=~/.config/git/gitconfig_user2
116
118
```
117
119
118
-
With the following contents of `gitconfig_user1` (and `gitconfig_user2`repspectively), `mapping_user1.ini`, which could contain a `target` entry to e.g. `github.com/user1` would always be invoked in `~/src/user1`:
120
+
With the following contents of `gitconfig_user1` (and `gitconfig_user2`respectively), `mapping_user1.ini`, which could contain a `target` entry to e.g. `github.com/user1` would always be invoked in `~/src/user1`:
119
121
120
122
```ini
121
123
[user]
@@ -129,13 +131,13 @@ See also the offical [documentation](https://git-scm.com/docs/git-config#_includ
129
131
### DEFAULT section
130
132
131
133
Defaults suitable for all entries of the mapping file can be specified in a special section of the configuration file named `[DEFAULT]`.
132
-
Everything configure in this section will automatically be available for all further entries in the file, but can be overriden there, too.
134
+
Everything configure in this section will automatically be available for all further entries in the file, but can be overridden there, too.
133
135
134
-
## Passwordstore Layout and Data Extraction
136
+
## Password Store Layout and Data Extraction
135
137
136
138
### Password
137
139
138
-
As usual with [pass], this helper assumes that the password is contained in the first line of the passwordstore entry.
140
+
As usual with [pass], this helper assumes that the password is contained in the first line of the password store entry.
139
141
Though uncommon, it is possible to strip a prefix from the data of the first line (such as `password:` by specifying an amount of characters to leave out in the `skip_password` field for an entry or also in the `[DEFAULT]` section to apply for all entries:
140
142
141
143
```ini
@@ -153,7 +155,7 @@ target=special/noprefix
153
155
154
156
`pass-git-helper` can also provide the username necessary for authenticating at a server.
155
157
In contrast to the password, no clear convention exists how username information is stored in password entries.
156
-
Therefore, multiple strategies to extract the username are implemented and can be selected globally for the whole passwordstore in the `[DEFAULT]` section, or individually for certain entries using the `username_extractor` key:
158
+
Therefore, multiple strategies to extract the username are implemented and can be selected globally for the whole password store in the `[DEFAULT]` section, or individually for certain entries using the `username_extractor` key:
157
159
158
160
```ini
159
161
[DEFAULT]
@@ -188,14 +190,14 @@ Configuration:
188
190
189
191
#### Strategy "entry_name"
190
192
191
-
Returns the last path fragment of the passwordstore entry as the username.
193
+
Returns the last path fragment of the password store entry as the username.
192
194
For instance, if a regular [pass] call would be `pass show dev/github.com/languitar`, the returned username would be `languitar`.
193
195
194
196
No configuration options.
195
197
196
198
### File Encoding
197
199
198
-
By default, passwordstore entries are assumed to use UTF-8 encoding.
200
+
By default, password store entries are assumed to use UTF-8 encoding.
199
201
If all or some of your entries use a different encoding, use the `encoding` key (for instance, in the `DEFAULT` section) to specify the used encoding.
0 commit comments