Git Large File Storage (LFS) uses text pointers in place of large files in Git repositories. In a default LFS configuration, the files are stored on the GitHub Enterprise appliance.

The Git LFS client will store large assets on the same server that is hosting the Git repository by default. When LFS is enabled on the GitHub Enterprise appliance, large assets are stored on the data partition in /data/user/storage.

Pushes containing LFS assets are rejected if LFS is disabled on the appliance or on a repository.

Configuring Git LFS to use a third party server

You can use LFS on a third party server by disabling LFS on the GitHub Enterprise appliance and configuring the Git LFS client with the URL for the server where you want to store large assets. Pushes that attempt to store LFS assets on the GitHub Enterprise appliance will be rejected.

Each repository will need to be configured to store its assets on the desired server. Git LFS uses a custom .lfsconfig file that you can commit into the repository so each user has the same settings.

# DEFAULT
git lfs env
git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c)
git version 2.7.4 (Apple Git-66)
Endpoint=https://GITHUB-ENTERPRISE-HOST/path/to/repo/info/lfs (auth=basic)
# SET A THIRD PARTY SERVER FOR LFS
git config -f .lfsconfig remote.origin.lfsurl https://THIRD-PARTY-LFS-SERVER/path/to/repo
git lfs env
git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c)
git version 2.7.4 (Apple Git-66)
Endpoint=https://THIRD-PARTY-LFS-SERVER/path/to/repo/info/lfs (auth=none)
# COMMIT THIS SO EVERY USER HAS SAME CONFIG
cat .lfsconfig
[remote "origin"]
    lfsurl = https://THIRD-PARTY-LFS-SERVER/path/to/repo

Migrating to a different LFS server

Migrate to a new LFS server by using the Git LFS client to fetch assets from the existing server and push them to the new location.

  1. Configure the repository with a second remote.

    git remote add NEW-REMOTE https://NEW-REMOTE-HOSTNAME/path/to/repo
    $ git lfs env
    git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c)
    git version 2.7.4 (Apple Git-66)
    Endpoint=https://GITHUB-ENTERPRISE-HOST/path/to/repo/info/lfs (auth=basic)
    Endpoint (NEW-REMOTE)=https://NEW-REMOTE-HOSTNAME/path/to/repo/info/lfs (auth=none)
    
  2. Fetch all objects from old remote.

    git lfs fetch origin --all
    Scanning for all objects ever referenced...
    ✔ 16 objects found
    Fetching objects...
    Git LFS: (16 of 16 files) 48.71 MB / 48.85 MB
    
  3. Push all objects to new remote.

    git lfs push NEW-REMOTE --all
    Scanning for all objects ever referenced...
    ✔ 16 objects found
    Pushing objects...
    Git LFS: (16 of 16 files) 48.00 MB / 48.85 MB, 879.10 KB skipped