====== 23 Git LFS ====== //Taken from [[https://www.git-tower.com/learn/git/ebook/en/command-line/advanced-topics/git-lfs|Git Tower's excellent online help]]:// > Working with large binary files can be quite a hassle: they bloat your local repository and leave you with Gigabytes of data on your machine. Most annoyingly, the majority of this huge amount of data is probably useless for you: most of the time, you don't need each and every version of a file on your disk. > > This problem in mind, Git's standard feature set was enhanced with the "Large File Storage" extension - in short: "Git LFS". An LFS-enhanced local Git repository will be significantly smaller in size because it breaks one basic rule of Git in an elegant way: it does not keep all of the project's data in your local repository. ===== How to use LFS ===== $ git lfs install $ git lfs track "*.vip" $ git add .gitattributes $ git add some-package.vip $ git commit -m "Add VI Package file" ===== Trouble Shooting ===== Sometimes, LFS will not behave as expected. In some cases, moving to the command line will solve the issue. The following steps are taken from the [[https://github.com/git-lfs/git-lfs/issues/911#issuecomment-169998792|git lfs GitHub page]]: // Skip smudge - We'll download binary files later in a faster batch git lfs install --skip-smudge // Do git clone here git clone ... // Fetch all the binary files in the new clone git lfs pull // Reinstate smudge git lfs install --force ===== Resources ===== * [[https://git-scm.com/docs/gitattributes]] * [[https://docs.gitlab.com/ee/topics/git/lfs/]]