The following options must be set in $GERRIT_SITE/etc/gerrit.config
.
lfs
The following options can be configured in lfs.config
on the refs/meta/config
branch of the All-Projects
project.
[lfs "sandbox/*"]
enabled = true
maxObjectSize = 10m
[lfs "public/*"]
enabled = true
maxObjectSize = 200m
[lfs "customerX/*"]
enabled = true
maxObjectSize = 500m
[lfs "customerY/*"]
enabled = false
A namespace can be specified as
exact project name (plugins/myPlugin
): Defines LFS settings for one project.
pattern (sandbox/*
): Defines LFS settings for one project namespace.
regular expression (^test-.*/.*
): Defines LFS settings for the namespace matching the regular expression.
for-each-pattern (?/*
): Defines the same LFS settings for each subfolder. ?
is a placeholder for any name and ?/*
with maxObjectSize = 100m
means that for every subfolder the maximum object size is 100 mb
. Hence ?/*
is a shortcut for having n explicit namespaces.
If a project name matches several lfs namespaces, the one the that is defined first in the lfs.config will be applied.
Example: Enable LFS for all projects, allowing unlimited object size for projects under /test
and limiting to 500 mb
for projects under other folders:
[lfs "test/*"]
enabled = true
[lfs "?/*"]
enabled = true
maxObjectSize = 500m
Example: Only enable LFS for projects under customer-A
:
[lfs "customer-A/*]
enabled = true
lfs
false
.k
, m
, and g
are supported.false
.storage.backend
from Global Plugin Settings.The following options can be configured in $GERRIT_SITE/etc/lfs.config
and $GERRIT_SITE/etc/lfs.secure.config.
locks
The Git LFS File Locking API specifies that a certain path can be locked by a user. It prevents the file being accidentally overwritten by a different user, and costly (manual in most cases) binary file merge. Each lock is represented by a JSON structure:
{
"id":"[lock id the same as lock file name]",
"path":"[path to the resource being locked]",
"locked_at":"[timestamp the lock was created in ISO 8601 format]",
"owner":{
"name":"[the name of the user that created the lock]"
}
}
The lock is stored in a file whose name is the SHA256 hash of the path being locked, under locks.directory
followed by the project name.
Default is $GERRIT_SITE/data/lfs/lfs_locks
.
auth
10
seconds.storage
fs
for local file system, and s3
for Amazon S3. If not set, defaults to fs
.fs
- default file system backendThe following configuration options are only used when the backend is fs
.
$GERRIT_SITE/data/lfs
.10
seconds.s3
- default S3 backendThe following configuration options are only used when the backend is s3
.
REDUCED_REDUNDANCY
accessKey
and secretKey
. This way the git-lfs extension doesn’t need any credentials to access objects in the S3 bucket. Validity of these request signatures expires after this period.60
seconds.true
: SSL verification is disabledfalse
: SSL verification is enabledfalse
.$GERRIT_SITE/etc/lfs.secure.config
.$GERRIT_SITE/etc/lfs.secure.config
.One can specify multiple LFS backends for both FS and S3 storage by introducing backend subsections:
[fs "foo"]
directory = /foo_dir
[s3 "bar"]
...
and use them for namespace configuration by adding backend namespace parameter:
[lfs "sandbox/*"]
backend = foo
...
[lfs "release/*"]
backend = bar
...
The following options must be set in the local project’s .git/config
file.
lfs
http://<username>@<gerrit-host>:<port>/<project-name>/info/lfs
When the Gerrit repo is cloned via ssh, the git lfs url must be set to use http.