Tutorials

Git LFS HowTo

How to install the LFS (Large File System) option for Git on Linux/Ubuntu:

1) First, download the git-lfs tar ball given here:

2) extract the tar ball:

tar zxf *.tar.gz

3) run the install script of the tar ball:

sudo ./install.sh

4) initialize git lfs for the current user

git lfs install

5) In your repo, add file extensions that should be tracked and handled as a large file, e.g. zip or bz2 files:

git lfs track "*.zip"
git lfs track "*.bz2"

6) This creates a .gitattributes file, that should be staged:

git add .gitattributes

7) Stage the large files that you want to store on the server-side, e.g. some compressed zip files:

git add *.zip

8) Commit the changes locally:

git commit -m “added zip files”

9) Push the changes to the server:

git push

10) When a file fails to upload because of a file size restriction and the file has not yet been tracked, the file needs to be migrated manually to lfs:

git lfs migrate import —include=file

Note: On GitHub 1GB of LFS storage is free, but any additional pack of 50GB costs $5 per month. The maximum file size for Git LFS is 2GB unless you upgrade your plan.

11) To download a LFS file on another computer, you need to pull:

git lfs pull

Options: