1GIT-LFS-CONFIG(5) File Formats Manual GIT-LFS-CONFIG(5)
2
3
4
6 git-lfs-config - Configuration options for git-lfs
7
9 git-lfs reads its configuration from any file supported by git config
10 -l, including all per-repository, per-user, and per-system Git configu‐
11 ration files.
12
13 Additionally, a small number of settings can be specified in a file
14 called .lfsconfig at the root of the repository; see the "LFSCONFIG"
15 section for more details. This configuration file is useful for setting
16 options such as the LFS URL or access type for all users of a reposi‐
17 tory, especially when these differ from the default. The .lfsconfig
18 file uses the same format as .gitconfig.
19
20 If the .lfsconfig file is missing, the index is checked for a version
21 of the file, and that is used instead. If both are missing, HEAD is
22 checked for the file. If the repository is bare, only HEAD is checked.
23 This order may change for checkouts in the future to better match Git´s
24 behavior.
25
26 Settings from Git configuration files override the .lfsconfig file.
27 This allows you to override settings like lfs.url in your local envi‐
28 ronment without having to modify the .lfsconfig file.
29
30 Most options regarding git-lfs are contained in the [lfs] section,
31 meaning they are all named lfs.foo or similar, although occasionally an
32 lfs option can be scoped inside the configuration for a remote.
33
35 General settings
36 ○ lfs.url / remote.<remote>.lfsurl
37
38 The url used to call the Git LFS remote API. Default blank (derive
39 from clone URL).
40
41 ○ lfs.pushurl / remote.<remote>.lfspushurl
42
43 The url used to call the Git LFS remote API when pushing. Default
44 blank (derive from either LFS non-push urls or clone url).
45
46 ○ remote.lfsdefault
47
48 The remote used to find the Git LFS remote API. lfs.url and
49 branch.*.remote for the current branch override this setting. If
50 this setting is not specified and there is exactly one remote, that
51 remote is picked; otherwise, the default is origin.
52
53 ○ remote.lfspushdefault
54
55 The remote used to find the Git LFS remote API when pushing.
56 lfs.url and branch.*.pushremote for the current branch override
57 this setting. If this setting is not set, remote.pushdefault is
58 used, or if that is not set, the order of selection is used as
59 specified in the remote.lfsdefault above.
60
61 ○ lfs.dialtimeout
62
63 Sets the maximum time, in seconds, that the HTTP client will wait
64 to initiate a connection. This does not include the time to send a
65 request and wait for a response. Default: 30 seconds
66
67 ○ lfs.tlstimeout
68
69 Sets the maximum time, in seconds, that the HTTP client will wait
70 for a TLS handshake. Default: 30 seconds.
71
72 ○ lfs.activitytimeout / lfs.https://<host>.activitytimeout
73
74 Sets the maximum time, in seconds, that the HTTP client will wait
75 for the next tcp read or write. If < 1, no activity timeout is used
76 at all. Default: 30 seconds
77
78 ○ lfs.keepalive
79
80 Sets the maximum time, in seconds, for the HTTP client to maintain
81 keepalive connections. Default: 30 minutes.
82
83 ○ lfs.ssh.automultiplex
84
85 When using the pure SSH-based protocol, whether to multiplex re‐
86 quests over a single connection when possible. This option requires
87 the use of OpenSSH or a compatible SSH client. Default: true.
88
89 ○ lfs.ssh.retries
90
91 Specifies the number of times Git LFS will attempt to obtain autho‐
92 rization via SSH before aborting. Default: 5.
93
94 ○ core.askpass, GIT_ASKPASS
95
96 Given as a program and its arguments, this is invoked when authen‐
97 tication is needed against the LFS API. The contents of stdout are
98 interpreted as the password.
99
100 ○ lfs.cachecredentials
101
102 Enables in-memory SSH and Git Credential caching for a single ´git
103 lfs´ command. Default: enabled.
104
105 ○ lfs.storage
106
107 Allow override LFS storage directory. Non-absolute path is rela‐
108 tivized to inside of Git repository directory (usually .git).
109
110 Note: you should not run git lfs prune if you have different repos‐
111 itories sharing the same storage directory.
112
113 Default: lfs in Git repository directory (usually .git/lfs).
114
115 ○ lfs.largefilewarning
116
117 Warn when a file is 4 GiB or larger. Such files will be corrupted
118 when using Windows (unless smudging is disabled) due to a limita‐
119 tion in Git. Default: true.
120
121
122
123 Transfer (upload / download) settings
124 These settings control how the upload and download of LFS content oc‐
125 curs.
126
127 ○ lfs.concurrenttransfers
128
129 The number of concurrent uploads/downloads. Default 8.
130
131 ○ lfs.basictransfersonly
132
133 If set to true, only basic HTTP upload/download transfers will be
134 used, ignoring any more advanced transfers that the client/server
135 may support. This is primarily to work around bugs or incompatibil‐
136 ities.
137
138 The git-lfs client supports basic HTTP downloads, resumable HTTP
139 downloads (using Range headers), and resumable uploads via tus.io
140 protocol. Custom transfer methods can be added via lfs.customtrans‐
141 fer (see next section). However setting this value to true limits
142 the client to simple HTTP.
143
144 ○ lfs.tustransfers
145
146 If set to true, this enables resumable uploads of LFS objects
147 through the tus.io API. Once this feature is finalized, this set‐
148 ting will be removed, and tus.io uploads will be available for all
149 clients.
150
151 ○ lfs.standalonetransferagent
152
153 Allows the specified custom transfer agent to be used directly for
154 transferring files, without asking the server how the transfers
155 should be made. The custom transfer agent has to be defined in a
156 lfs.customtransfer.<name> settings group.
157
158 ○ lfs.customtransfer.<name>.path
159
160 lfs.customtransfer.<name> is a settings group which defines a cus‐
161 tom transfer hook which allows you to upload/download via an inter‐
162 mediate process, using any mechanism you like (rather than just
163 HTTP). path should point to the process you wish to invoke. The
164 protocol between the git-lfs client and the custom transfer process
165 is documented at
166 https://github.com/git-lfs/git-lfs/blob/main/docs/custom-trans‐
167 fers.md
168
169 name must be a unique identifier that the LFS server understands.
170 When calling the LFS API the client will include a list of sup‐
171 ported transfer types. If the server also supports this named
172 transfer type, it will select it and actions returned from the API
173 will be in relation to that transfer type (may not be traditional
174 URLs for example). Only if the server accepts name as a transfer it
175 supports will this custom transfer process be invoked.
176
177 ○ lfs.customtransfer.<name>.args
178
179 If the custom transfer process requires any arguments, these can be
180 provided here. This string will be expanded by the shell.
181
182 ○ lfs.customtransfer.<name>.concurrent
183
184 If true (the default), git-lfs will invoke the custom transfer
185 process multiple times in parallel, according to lfs.concurrent‐
186 transfers, splitting the transfer workload between the processes.
187
188 ○ lfs.customtransfer.<name>.direction
189
190 Specifies which direction the custom transfer process supports, ei‐
191 ther "download", "upload", or "both". The default if unspecified is
192 "both".
193
194 ○ lfs.transfer.maxretries
195
196 Specifies how many retries LFS will attempt per OID before marking
197 the transfer as failed. Must be an integer which is at least one.
198 If the value is not an integer, is less than one, or is not given,
199 a value of eight will be used instead.
200
201 ○ lfs.transfer.maxretrydelay
202
203 Specifies the maximum time in seconds LFS will wait between each
204 retry attempt. LFS uses exponential backoff for retries, doubling
205 the time between each retry until reaching this limit. If a server
206 requests a delay using the Retry-After header, the header value
207 overrides the exponential delay for that attempt and is not limited
208 by this option.
209
210 Must be an integer which is not negative. Use zero to disable de‐
211 lays between retries unless requested by a server. If the value is
212 not an integer, is negative, or is not given, a value of ten will
213 be used instead.
214
215 ○ lfs.transfer.maxverifies
216
217 Specifies how many verification requests LFS will attempt per OID
218 before marking the transfer as failed, if the object has a verifi‐
219 cation action associated with it. Must be an integer which is at
220 least one. If the value is not an integer, is less than one, or is
221 not given, a default value of three will be used instead.
222
223 ○ lfs.transfer.enablehrefrewrite
224
225 If set to true, this enables rewriting href of LFS objects using
226 url.*.insteadof/pushinsteadof config. pushinsteadof is used only
227 for uploading, and insteadof is used for downloading and for up‐
228 loading when pushinsteadof is not set.
229
230
231
232 Push settings
233 ○ lfs.allowincompletepush
234
235 When pushing, allow objects to be missing from the local cache
236 without halting a Git push. Default: false.
237
238
239
240 Fetch settings
241 ○ lfs.fetchinclude
242
243 When fetching, only download objects which match any entry on this
244 comma-separated list of paths/filenames. Wildcard matching is as
245 per git-ignore(1). See git-lfs-fetch(1) for examples.
246
247 ○ lfs.fetchexclude
248
249 When fetching, do not download objects which match any item on this
250 comma-separated list of paths/filenames. Wildcard matching is as
251 per git-ignore(1). See git-lfs-fetch(1) for examples.
252
253 ○ lfs.fetchrecentrefsdays
254
255 If non-zero, fetches refs which have commits within N days of the
256 current date. Only local refs are included unless lfs.fetchrecen‐
257 tremoterefs is true. Also used as a basis for pruning old files.
258 The default is 7 days.
259
260 ○ lfs.fetchrecentremoterefs
261
262 If true, fetches remote refs (for the remote you´re fetching) as
263 well as local refs in the recent window. This is useful to fetch
264 objects for remote branches you might want to check out later. The
265 default is true; if you set this to false, fetching for those
266 branches will only occur when you either check them out (losing the
267 advantage of fetch --recent), or create a tracking local branch
268 separately then fetch again.
269
270 ○ lfs.fetchrecentcommitsdays
271
272 In addition to fetching at refs, also fetches previous changes made
273 within N days of the latest commit on the ref. This is useful if
274 you´re often reviewing recent changes. Also used as a basis for
275 pruning old files. The default is 0 (no previous changes).
276
277 ○ lfs.fetchrecentalways
278
279 Always operate as if --recent was included in a git lfs fetch call.
280 Default false.
281
282
283
284 Prune settings
285 ○ lfs.pruneoffsetdays
286
287 The number of days added to the lfs.fetchrecent* settings to deter‐
288 mine what can be pruned. Default is 3 days, i.e. that anything
289 fetched at the very oldest edge of the ´recent window´ is eligible
290 for pruning 3 days later.
291
292 ○ lfs.pruneremotetocheck
293
294 Set the remote that LFS files must have been pushed to in order for
295 them to be considered eligible for local pruning. Also the remote
296 which is called if --verify-remote is enabled.
297
298 ○ lfs.pruneverifyremotealways
299
300 Always run git lfs prune as if --verify-remote was provided.
301
302
303
304 Extensions
305 ○ lfs.extension.<name>.<setting>
306
307 Git LFS extensions enable the manipulation of files streams during
308 smudge and clean. name groups the settings for a single extension,
309 and the settings are: * clean The command which runs when files are
310 added to the index * smudge The command which runs when files are
311 written to the working copy * priority The order of this extension
312 compared to others
313
314
315
316 Other settings
317 ○ lfs.<url>.access
318
319 Note: this setting is normally set by LFS itself on receiving a 401
320 response (authentication required), you don´t normally need to set
321 it manually.
322
323 If set to "basic" then credentials will be requested before making
324 batch requests to this url, otherwise a public request will ini‐
325 tially be attempted.
326
327 ○ lfs.<url>.locksverify
328
329 Determines whether locks are checked before Git pushes. This pre‐
330 vents you from pushing changes to files that other users have
331 locked. The Git LFS pre-push hook varies its behavior based on the
332 value of this config key.
333
334 ○ null - In the absence of a value, Git LFS will attempt the call,
335 and warn if it returns an error. If the response is valid, Git LFS
336 will set the value to true, and will halt the push if the user at‐
337 tempts to update a file locked by another user. If the server re‐
338 turns a 501 Not Implemented response, Git LFS will set the value to
339 false.
340
341 ○ true - Git LFS will attempt to verify locks, halting the Git push
342 if there are any server issues, or if the user attempts to update a
343 file locked by another user.
344
345 ○ false - Git LFS will completely skip the lock check in the pre-push
346 hook. You should set this if you´re not using File Locking, or your
347 Git server verifies locked files on pushes automatically.
348
349
350
351 Supports URL config lookup as described in:
352 https://git-scm.com/docs/git-config#git-config-httplturlgt. To set this
353 value per-host: git config --global lfs.https://github.com/.locksverify
354 [true|false].
355
356 ○ lfs.<url>.contenttype
357
358 Determines whether Git LFS should attempt to detect an appropriate
359 HTTP Content-Type header when uploading using the ´basic´ upload
360 adapter. If set to false, the default header of Content-Type: ap‐
361 plication/octet-stream is chosen instead. Default: ´true´.
362
363 ○ lfs.skipdownloaderrors
364
365 Causes Git LFS not to abort the smudge filter when a download error
366 is encountered, which allows actions such as checkout to work when
367 you are unable to download the LFS content. LFS files which could
368 not download will contain pointer content instead.
369
370 Note that this will result in git commands which call the smudge
371 filter to report success even in cases when LFS downloads fail,
372 which may affect scripts.
373
374 You can also set the environment variable GIT_LFS_SKIP_DOWNLOAD_ER‐
375 RORS=1 to get the same effect.
376
377 ○ GIT_LFS_PROGRESS
378
379 This environment variable causes Git LFS to emit progress updates
380 to an absolute file-path on disk when cleaning, smudging, or fetch‐
381 ing.
382
383 Progress is reported periodically in the form of a new line being
384 appended to the end of the file. Each new line will take the fol‐
385 lowing format:
386
387 <direction> <current>/<total files> <downloaded>/<total> <name>
388
389 Each field is described below: * direction: The direction of trans‐
390 fer, either "checkout", "download", or "upload". * current The in‐
391 dex of the currently transferring file. * total files The estimated
392 count of all files to be transferred. * downloaded The number of
393 bytes already downloaded. * total The entire size of the file, in
394 bytes. * name The name of the file.
395
396 ○ GIT_LFS_FORCE_PROGRESS lfs.forceprogress
397
398 Controls whether Git LFS will suppress progress status when the
399 standard output stream is not attached to a terminal. The default
400 is false which makes Git LFS detect whether stdout is a terminal
401 and suppress progress when it´s not; you can disable this behaviour
402 and force progress status even when standard output stream is not a
403 terminal by setting either variable to 1, ´yes´ or ´true´.
404
405 ○ GIT_LFS_SKIP_SMUDGE
406
407 Sets whether or not Git LFS will skip attempting to convert point‐
408 ers of files tracked into their corresponding objects when checked
409 out into a working copy. If ´true´, ´1´, ´on´, or similar, Git LFS
410 will skip the smudge process in both git lfs smudge and git lfs
411 filter-process. If unset, or set to ´false´, ´0´, ´off´, or simi‐
412 lar, Git LFS will smudge files as normal.
413
414 ○ GIT_LFS_SKIP_PUSH
415
416 Sets whether or not Git LFS will attempt to upload new Git LFS ob‐
417 ject in a pre-push hook. If ´true´, ´1´, ´on´, or similar, Git LFS
418 will skip the pre-push hook, so no new Git LFS objects will be up‐
419 loaded. If unset, or set to ´false´, ´0´, ´off´, or similar, Git
420 LFS will proceed as normal.
421
422 ○ GIT_LFS_SET_LOCKABLE_READONLY lfs.setlockablereadonly
423
424 These settings, the first an environment variable and the second a
425 gitconfig setting, control whether files marked as ´lockable´ in
426 git lfs track are made read-only in the working copy when not
427 locked by the current user. The default is true; you can disable
428 this behaviour and have all files writeable by setting either vari‐
429 able to 0, ´no´ or ´false´.
430
431 ○ lfs.lockignoredfiles
432
433 This setting controls whether Git LFS will set ignored files that
434 match the lockable pattern read only as well as tracked files. The
435 default is false; you can enable this behavior by setting the vari‐
436 able to 1, ´yes´, or ´true´.
437
438 ○ lfs.defaulttokenttl
439
440 This setting sets a default token TTL when git-lfs-authenticate
441 does not include the TTL in the JSON response but still enforces
442 it.
443
444 Note that this is only necessary for larger repositories hosted on
445 LFS servers that don´t include the TTL.
446
447
448
450 The .lfsconfig file in a repository is read and interpreted in the same
451 format as the file stored in .git/config. It allows a subset of keys to
452 be used, including and limited to:
453
454 ○ lfs.allowincompletepush
455
456 ○ lfs.fetchexclude
457
458 ○ lfs.fetchinclude
459
460 ○ lfs.gitprotocol
461
462 ○ lfs.locksverify
463
464 ○ lfs.pushurl
465
466 ○ lfs.skipdownloaderrors
467
468 ○ lfs.url
469
470 ○ lfs.{*}.access
471
472 ○ remote.{name}.lfsurl
473
474
475
476 The set of keys allowed in this file is restricted for security rea‐
477 sons.
478
480 Configure a custom LFS endpoint for your repository:
481
482
483 git config -f .lfsconfig lfs.url https://lfs.exam‐
484 ple.com/foo/bar/info/lfs
485
487 git-config(1), git-lfs-install(1), gitattributes(5)
488
489 Part of the git-lfs(1) suite.
490
491
492
493 October 2021 GIT-LFS-CONFIG(5)