I am working as an iOS Developer in a white label project and because of this, we have a repository with all the project resources (images, fonts, texts, etc.) and also we generate a bundle file for each product (along with the car
files with images and colors). For those who don't know, the bundle file is actually a folder that stores all assets, something like a package. We use this to change easily all resources for a different product and we want to build statically, instead of getting the assets by a backend.
The problem that we have in the project and that I seek other questions always talk about big files, but the problem isn't big files, it's a set of small binary files and the bundle files is (about 5mb with all files and 14mb, respectively, for each product), but the repository is always getting bigger and bigger because of git history. For some developers, they have about 2gb in their Macs only in this repository.
I have already use git repack -a -d --depth=250 --window=250
and we had some improvements, but in two weeks it's already big again and I have to use again.
The question that I have is: what should be the best way to store these files? I see that some people recommends using Git LFS or SVN, but I always see for files that are much bigger than the ones I have, so I think if wouldn't be too much for a simple problem and what should be all the alternatives before I make a decision and regret it later.
If you're storing the bundle files in Git, definitely don't do that. Git should not be used to store any build product or external dependency, such as a framework. Git should be used to store only the contents of this particular project.
If, having said that, you still have a decent number of binary files, you can try Git LFS. That's the typical solution for this case.
However, if your Git server is using a recent version of Git (for example, GitHub), then you can also just re-clone the repositories using partial clone instead. That will preserve your history, but avoid downloading larger blobs, and just fetch them from the server as they're needed for checkouts or other operations. Note that this requires a very recent version of Git on your Mac, which you will have if you use Homebrew's git
package.
You can do that by running git clone --filter=blob:limit=1m URL
, which will prevent pulling down blobs larger than 1 MiB.