Git의 용량제한과 LFS

기본적으로 git은 여러개의 작은 소스코드 파일들을 위한 버전 컨트롤 시스템(VCS)이다. 따라서 Github의 경우 50Mb부터 Warning이 표시되고, 100Mb부터는 push시 Error가 발생한다. 그럼에도 불구하고 경우에 따라서 반드시 대용량 파일을 git repo에 포함시켜야하는 상황이 존재할 수 있다(예를 들면 학습된 모델파라미터를 올려야할 때). 이러한 경우에 사용할 수 있는 해결책인 Git LFS(Large File Storage)을 소개한다.

git lfs가 정상적으로 적용된 경우, 아주 큰 파일에 대해서도 git push와 pull이 가능해진다.

기본적인 사용방법은 다음 블로그에서 가져왔다.

https://leimao.github.io/blog/Git-Large-File-Storage/

https://git-lfs.github.com/

Github LFS 가이드 문서

https://docs.github.com/en/github/managing-large-files/working-with-large-files

Git LFS 기능 설치하기

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash

sudo apt install git-lfs

https://github.com/git-lfs/git-lfs/wiki/Installation

https://github.com/git-lfs/git-lfs/releases/tag/v2.10.0

특정 repo에 git lfs 적용하기

(해당 레포로 이동 후)

git lfs install

특정 repo에 git lfs 해제하기

(해당 레포로 이동 후)

git lfs uninstall