# Common GitLFS cache configuration

**URL:** https://discuss.bitrise.io/t/common-gitlfs-cache-configuration/20303
**Category:** Question & Answer
**Created:** [June 3, 2022, 2:11pm UTC](https://discuss.bitrise.io/t/common-gitlfs-cache-configuration/20303 "2022-06-03T14:11:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chrishs](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chrishs](https://discuss.bitrise.io/u/chrishs)
#### Post date: [June 3, 2022, 2:11pm UTC](https://discuss.bitrise.io/t/common-gitlfs-cache-configuration/20303/1 "2022-06-03T14:11:04Z")

</div>

Hey,

Git LFS, powerful, yet not free. CI can generate a lot of bandwidth pulling the same files (e.g. binary frameworks) over and over again.

I am looking for a simple solution, how to:  
**Clone repository, but retrieve LFS objects from cache if possible. If LFS object(s) is missing or outdated pull it and put it in the cache, to improve next run.**

I found similar topics: [one](https://discuss.bitrise.io/t/how-to-cache-the-source-code-directory/1533/4), [two](https://discuss.bitrise.io/t/git-lfs-caching-is-it-possible/3570), but they don’t contain a “copy-n-paste” answer or are still not fully answered. I am trying to understand how exactly cache-pull/push and clone steps are configured.

I think the use-case is so “normal” that it would be awesome if it was a default behaviour (optionally configurable).

Cheers!

---

<div class="post-metadata">

### Author: ![chrishs](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chrishs](https://discuss.bitrise.io/u/chrishs)
#### Post date: [June 3, 2022, 3:26pm UTC](https://discuss.bitrise.io/t/common-gitlfs-cache-configuration/20303/2 "2022-06-03T15:26:29Z")

</div>

I’ve managed to do something like this, but I believe it’s just too much…

```auto
  my_workflow:
    description: Whatever
    steps:
    - script@1:
        inputs:
        - content: git lfs uninstall
        title: Uninstall LFS
    - git-clone@6.1: {}
    - cache-pull:
        inputs:
        - is_debug_mode: 'true'
    - script@1:
        inputs:
        - content: |-
            git lfs install
            git lfs pull
        title: Install LFS and Pull
    - cache-push@2:
        inputs:
        - compress_archive: 'true'
        - cache_paths: |-
            .git/lfs

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)
#### Post date: [July 3, 2022, 3:27pm UTC](https://discuss.bitrise.io/t/common-gitlfs-cache-configuration/20303/3 "2022-07-03T15:27:29Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
