I created a Git repo that will exclusively be stored locally and I ask myself, if I really need Git LFS for binaries? As far as I can see, the .gitattributes
is properly configured as in:
*.psd binary
And yes, the files land in .git/objects/...
, but they are compressed and don't take much space. So to sum it up, what are the benefits of Git LFS in a local repository if I never push/pull from/to a remote repo?
Thanks!
git-lfs
stores old versions of file contents in the cloud while keeping their history on disk. This has two main benefits.
git clone
of a repository.Obviously number 1 doesn't apply if the repository is never shared.
If these binaries are really large, and if you change them frequently, they may begin to impact your available free disk space. If so, git-lfs can be of benefit by offloading the old copies of the binaries to cloud storage.
Fortunately, you can always retroactively apply git-lfs later using the BFG Repo Cleaner if the local repo gets too large.
As far as I can see, the .gitattributes is properly configured as in:
*.psd binary
This is a separate issue from git-lfs
.
If the file is marked as binary, Git will assume it cannot usefully diff nor merge the contents. Every time you change the file Git will store a complete copy of the file. This will obviously eat up a lot more disk space.
Even if the file is "binary" (ie. not plain text), Git may be able to store only the change if you don't mark it as binary. However, if the file is already compressed this effectively randomizes the file contents and makes diffing impossible. Many image formats are compressed.
Alexander Gogl did some experiments in their answer and it seems Git will store the whole .psd file.