Previously available on Bitbucket Server, Git Large File Storage now reaches Bitbucket Cloud, Atlassian’s cloud-based code management solution, writes Atlassian engineer Szilard Szasz-Toth.
The basic idea behind Git LFS is storing large, binary files in parallel storage, while Git repositories only include lightweight references to those files. So, a binary file change history can be represented through the sequence of references to its actual versions, instead of full copies of them. This makes cloning and pulling newer versions of your repository much faster, since only the currently checked out versions of large files will be downloaded.
According to Szasz-Toth, Git LFS is particularly relevant for game developers, mobile developers who support higher display resolutions, and web developers who use rich media. Additionally, it enables efficient use of Git for non-code related tasks, such as storing presentations, datasets, test database images, and more.
Created and currently maintained by GitHub, Git LFS is an open-source Git extension aimed to better integrate large binary files, including audio, video, and graphics within Git repositories.
Git LFS extends Git by adding a new lfs
command to it, which supports the following options:
- config: display Git LFS configuration.
- init: initialized Git LFS.
- logs: show errors from git-lfs.
- track: add a large file to Git repo; it allows to specify a file extension.
- untrack: remove a file from Git LFS.
- push: push tracked files to Git LFS endpoint.
- status: displays paths of modified Git LFS objects.
This is how you would add a large file to an existing repo:
git lfs track "*.pdf"
git add file.pdf
git commit -m "Add design file"
git push origin master
As Szasz-Toth remarks, support for Git LFS is already included in SourceTree, Atlassian graphical Git client.