Using git-lfs in snap builds

Asked by Michał Sawicz

Hi, has anyone got git-lfs working in snap builds?

I have a GitHub repo that's imported and built on LP, and am trying to add some large files through LFS…

https://github.com/canonical/checkbox-mir/pull/12/commits/3753efdc2272fff8a75f682a04c118a84dec93c4

Things work in GitHub Actions, but I [can't get](https://launchpadlibrarian.net/715002055/buildlog_snap_ubuntu_jammy_armhf_checkbox-mir-amrhf_BUILDING.txt.gz) `git lfs pull` to work on Launchpad:

```
:: + git -C /build/checkbox-mir lfs pull
:: batch response: Authorization error: https://github.com/canonical/checkbox-mir.git/objects/batch
:: Check that you have proper access to the repository
:: error: failed to fetch some objects from 'https://github.com/canonical/checkbox-mir.git
```

Any ideas? Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Michał Sawicz
Solved:
Last query:
Last reply:
Revision history for this message
Michał Sawicz (saviq) said :
#1

Answering myself, an `.lfsconfig` file with these contents seems to do:

```ini
[lfs]
 url = https://github.com/<owner>/<repo>.git/info/lfs
 pushurl = ssh://<email address hidden>/<owner>/<repo>.git
```

Ref. https://github.com/git-lfs/git-lfs/blob/main/docs/man/git-lfs-config.adoc