Enable LFS for a repository

You can enable LFS for both existing and new repositories.

This section provides instructions to set up LFS for both exiting and new repositories.

Setting up LFS for existing repositories

  1. Log on to TeamForge, select Project Home > Source Code, and select (click) a repository.
  2. Select Settings > Polices.
  3. To enable LFS, you must select the values for MAX LFS OBJECT SIZE and GIT LFS ENABLED fields.
    • MAX LFS OBJECT SIZE (required field): Select one of the values: Inherited, Unlimited, Read-only or Limited to. By default Inherited value is READ_ONLY. It means that once LFS data is pushed into repository it is always available for fetch/clone operation. Even if you switch to Unlimited, for example, and then decide to go back to READ_ONLY at a later point in time for a given repository or integration, repository consistency is preserved and data would always be available. This is necessary to prevent situations where crucial binary data is always readable unless you rewrite the repository history to render such binary data unavailable. Select:
      • Inherited that makes this repository inherit the default Git-integration settings. Note that in case of Inherited, current default integration setting is shown for your reference.
      • Unlimited to support unlimited object size (size is not proactively limited by Gerrit but space availability still applies).
      • Limited to to limit maximum object size to a reasonable value, for example, 100MB.
      • Read-only that turns LFS in this repository to read-only mode.
    • GIT LFS ENABLED (optional field): Select one of the values: Inherited, true or false. The inherited value is false by default. LFS is served from master Gerrit instance over HTTP/HTTPS protocol and therefore you must enable this parameter to extend the checkout URLs with LFS specific part for SSH protocol and replication. This is required as the LFS client, by default, uses the same URL (derives the protocol from it) that is used for fetch/clone/push operations, while pointing to the master Gerrit instance over HTTP/HTTPS to read/write data.
    The following illustration shows a typical LFS configuration where the MAX LFS OBJECT SIZE is limited to 100 MB for a repository that's server over SSH:

Setting up LFS when a new repository is created

  1. Log on to TeamForge, select Project Home > Source Code, and click Create Repository.
  2. Select the values for MAX LFS OBJECT SIZE and GIT LFS ENABLED fields while creating the new repository and click Save.