How to make git-lfs available in TrueNAS?

Hello.

I have Gitea installed via Docker. But, its repository mirror (to Github) feature doesn’t work well if/when any files are larger than 100MB. To get around this, I want to use “Large File Storage” (LFS). Gitea has an LFS server built into it. But, in order to connect to that, you still need to install and apply “git-lfs” to large files.

The problem is that I am tracking some files on my TrueNAS server in a repo and running automatic commits via cron. So, I technically need git-lfs to be installed on TrueNAS.

I do not want to violate the “no use of apt” in TrueNAS Scale in order to install it. So, my preference would be to put git-lfs into a custom docker and then reference it from there. But, building a custom docker is new to me and am not sure if that is the most practical solution here.

Any ideas? References to how-to in my context would be great.

Thanks in advance for any help you can offer.

Hello,

I’m trying to understand further, are the files you are tracking resides in a separate dataset? If yes, how did you get “git” command to run in those dataset?

Btw, you could mount an additional dataset into the Gitea, and configure Gitea’s ini file for Git LFS as below:

[server]
LFS_START_SERVER = true

[lfs]
; Where your lfs files reside, default is data/lfs.
PATH = Specify your path to the newly mounted dataset

Then, from your working folder, you need to run command to track lfs files, for example:

git lfs track "*.psd"

Now, when you commit, it should store all files with *psd extension into the LFS and create a pointer to the LFS in the Git tracking.