Set up LFS client and work with large files

Download the Git LFS client for your platform. Instructions in this topic are valid for Git LFS client 1.3 and later. The checkout URLs are automatically extended with LFS part and you do not have to modify the checkout URL manually to have it working out of the box for SSH protocol or replication scenarios.

For downloading Git LFS client, see Git Large File Storage page.

Working with LFS over HTTP/HTTPS (without replication)

  1. Use extended checkout URL.


    git clone -c
          ssh:// && cd "test_repo" && git
          config "Nancy S." && git config "" && git config
          url."ssh://".insteadOf "ssh://"
          && git config url."ssh://".insteadOf
          "ssh://" && git config
          "ssh://" && scp -P 29418
  2. Select the file types you'd like Git LFS to manage. You can configure additional file extensions anytime.

    The following command tracks all .jpg images in a given working directory.

    • git lfs track *.jpg
  3. Create a commit by adding the binary file and the technical file (.gitattributes) that is modified by Git LFS client.
    • git add IMG_0036.jpg .gitattributes
  4. Commit and push the file(s) to the remote repository.
    • git commit -sm 'This is LFS test' && git push origin HEAD:master
    The binary file that is successfully pushed to LFS manifests itself by having a reference file committed to Gerrit and you can check its content by going to TeamForge code browser for the given repository. Here is an example reference file. It contains Git LFS protocol version specification along with Git LFS object SHA and its size.