本文由 AI 分析生成
建立時間: 2026-03-28 來源: https://codychen.me/2023/02/github-lfs-好貴只能靠自己架設-gitlfs-server-了/
Summary
Short practical guide by Cody Chen on self-hosting a Git LFS server using Gitea on TrueNAS Scale, motivated by GitHub LFS’s 5GB free tier limit and bandwidth costs. Bonus: use Gitea as an off-site mirror for GitHub repos while sharing the LFS storage between both.
Cody Chen 的簡短實用指南,介紹在 TrueNAS Scale 上使用 Gitea 自架 Git LFS 伺服器,動機是 GitHub LFS 的 5GB 免費配額限制和頻寬費用。額外好處:使用 Gitea 作為 GitHub 倉庫的異地備份,同時讓 Gitea 和 GitHub 共享同一個 LFS 存儲位置。
Key Points
- GitHub LFS free tier: 5GB storage limit; files >100MB require LFS
- Solution: self-host LFS via Gitea on TrueNAS Scale
- Key configuration: set
.lfsconfigto point LFS URL at self-hosted Gitea instance - Dual-purpose: Gitea mirrors GitHub repos AND serves as the LFS backend for both
- Commands:
git lfs install,git lfs track datasets/*,git lfs push origin
Insights
The elegant trick here is using a single Gitea instance to serve two functions simultaneously: an off-site backup mirror (Gitea periodically pulls from GitHub) and a shared LFS backend (configured via .lfsconfig to override GitHub’s LFS endpoint). This means large file uploads go to self-hosted storage, while metadata/code still goes to GitHub. For users with homelab NAS infrastructure already running (TrueNAS), this is essentially free storage with no bandwidth limits.
Connections
Raw Excerpt
Github 有一個限制,就是當單檔案大於 100M 時,就會使用到 LFS 的儲存空間,並且上限是 5GB,我是窮苦人家,只能土法煉鋼自己架設 LFS Server。