Github 有一個限制,就是當單檔案大於 100M 時,就會使用到 LFS 的儲存空建,並且上限是 5GB
我是窮苦人家,只能土法煉鋼自己架設 LFS Server

Required

https://git-lfs.com/ 這裡下載並安裝 git-lfs

Gitea

我是在 TrueNAS Scale 上安裝 Gitea 的,至於安裝過程可以參考 Self Hosting Gitea On TrueNAS Scale With Working SSH Access

然而我覺得純粹充當 LFS Server 有點浪費,所以我覺得可以搭配異地備份的概念

讓 Gitea 定時從 Github 將專案抓回來,但指定 Gitea LFS 為 Gitea 和 Github 共同的位置

LFS

在 repo 底下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

|

# 初始化
git lfs install
# 設定 Git LFS 位置
git config -f .lfsconfig lfs.url url = https://<Domain>/<User>/<Project>.git/info/lfs
## 將設定檔加入 Git 追蹤
git add .lfsconfig
## 定義大檔案位置
git lfs track datasets/*
## 上傳時,會同時上傳 LFS
git push
## 或者只上傳 LFS 檔案
git lfs push origin
## 重新上傳 LFS
git lfs push --all origin main

|

Ref

  • 利用 Gitea 架一台 GitLFS Server