字體:  

CentOS 6.8 使用git lfs 需將 git 升級到 2.x 版(git2u)

htctouch 發表於: 2017-7-18 16:30 來源: ADJ網路控股集團


一個 machine learning 的專案難免會有些比較大的 model 檔案,但是 github 無法幫我們管理超過 100MB 的檔案,這時候我們必須另外找空間存放這些大型檔案。如果後續要在另外一台機器 clone 這一個 repo 下來執行的時候,也要去另外的空間把大型檔案都抓回來才有辦法開始執行,相當麻煩

Git Large File Storage 可以幫我們解決這個問題。我們可以使用 git lfs 在同一個 repo 底下新增大型檔案,並對該檔案作版本控制,目前免費的流量是 1GB / month,用了這個之後就不會再看到檔案過大的錯誤訊息了。

You can use ius CentOS repository to install Git 2.x.
As of 2017-07-18, the latest available version from ius is 2.13.2.

再來安裝 git-lfs
1.Install git >= 1.8.2
# curl -s https://setup.ius.io/ | sudo bash
# yum install git2u

Verify the version of Git that was installed:
# git --version

2. To install the git-lfs repo, run
# curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
# yum install git-lfs
# git lfs install

這樣就可以囉~