Git-lfs caching, is it possible?

We’ve recently started using git’s LFS (Large File Support) extension. Our repository is running on GitHub.
We ran into some issues where we went over our quota on GitHub because Bitrise seems to be downloading the LFS dependencies over and over again, which will rapidly become very expensive for us.

Is there some way to cache the git-lfs dependencies between builds?

I have found a caching article for cocoapods with the cache steps in a workflow, but git-lfs work during the git clone phase, so I don’t know if this will work for us…

2 Likes

Hi @scspijker,

Sure, it’s definitely possible. As git LFS is just a git “plugin”, the same rules apply for it as with the git repo itself.

This means that it’s not possible to only cache the LFS files without the rest of the repository, without extensive tweaking. But you can of course cache the whole repo, including the LFS files. You can find the related How To guide here:

If you’d have any questions, issues or feedback just let us know! :wink:

2 Likes

Cool, thanks!
I’ve added the caching step per instructions and will report back whether this helps our bandwidth issues :slight_smile:

1 Like

Thanks, please definitely do, I’m interested :wink:

Definitely looks like this is working. Our bandwidth is not used exponentially anymore, and Bitrise build still reliable :+1: Thnx

1 Like

Glad to hear, thanks for reporting @scspijker! :slight_smile:

I ran into an issue with the git clone step not playing nice with the cache:

1 Like

Bumped the related task’s priority in our backlog!