Git Large File Storage (LFS)

Still need help?

The Atlassian Community is here for you.

Ask the community

Git Large File Storage (or LFS) is a new, open-source extension to Git that aims to improve handling of large files. It does this by replacing large files in your repository—such as graphics and videos—with simple text pointers.

Git LFS is disabled by default within Bitbucket Server.

Important Notices

  • The Bitbucket Server Smart Mirroring feature does not support Git LFS content. You currently need to clone from the primary instance if the repository contains LFS content.
  • SSL should be configured and the Base URL should be configured to a "https" URL. While Git LFS does support SSH remotes, the actual download & upload of LFS objects is via HTTP(S). SSL configuration is not a requirement but is strongly recommended.
  • Please refer to Bitbucket Server Supported Platforms to ensure use of a compatible version of the Git LFS client.

  • The user running the Bitbucket Server instance should not have the Git LFS client executable installed.

Enabling Git LFS for a repository

Git LFS is disabled by default within Bitbucket Server.

  1. Go to Repository settings > Large file support (LFS)
  2. Tick the Allow LFS option. 
  3. Save your settings.

Installing the Git LFS command line client

To install Git LFS locally

Download and install the Git command line extension. You only have to set up Git LFS once.

git-lfs install

 

  1. Enter the file types you'd like Git LFS to manage.

    git lfs track "*.jpg"
  2. Commit and push to Bitbucket as you normally would, ensuring that as the .gitattributes file is updated when git lfs track or git lfs untrack is executed, it is also committed to the repository.

You're ready to start versioning large files with Git LFS.

Disabling Git LFS for Bitbucket Server

Bitbucket Server is shipped with Git LFS support enabled on the instance by default, however it can be disabled.

To disable Git LFS on the entire Bitbucket Server instance

  1. Log in to Bitbucket Server with sysadmin permissions.
  2. Go to Admin > Server settings.
  3. Untick the Git LFS enabled option.
  4. Save your settings.
Last modified on Feb 14, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.