728x90
반응형

소스 트리(Git)푸쉬 에러 화면

Git에 커밋을 하고 Push를 할 때 용량이 100MB 이상이면 푸쉬가 되지 않는다.

이럴때는 LFS를 사용해서 따로 관리해 주어야한다.

우선 GitHub를 로그인에 프로필을 누르고 Setting > Billing and plans > Plans and usage를 클릭해 밑 부분에 Git LFS Data의 용량을 확인해야 한다.

무료 기준 1GB가 최대 (최대 용량을 늘리고 싶으면 결제 필요)

그 다음 git LFS 홈페이지에 들어가서 LFS를 다운 받는다.
주소 : https://git-lfs.com/

 

Git Large File Storage

Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.

git-lfs.com

 

다운을 받았으면 해당 프로젝트 폴더에 우클릭 > Git Bash Here

해당 창이 나오면

1. // git-lfs 설치
git lfs install

2. // lfs로 관리할 파일(용량이 100MB이상) 등록
git lfs track (file path)

3. // gitattributes 파일 생성
git lfs .gitattributes

4. // 원격 저장소에 푸쉬
git add (file name)
git commit -m (commit_message)
git push origin main

를 입력한다. 본인은 
git lfs install
git lfs track D:/Project Solo/Assets/Firebase/Plugins/x86_64/FirebaseCppApp-11_6_0.so
git lfs track D:/Project Solo/Assets/Firebase/Plugins/x86_64/FirebaseCppApp-11_6_0.bundle
git lfs .gitattributes
git add --all
git commit -m "init commit"
git push origin main
순으로 진행하였다.

번외로 소스 트리로도 LFS 관리가 가능하다.
저장소 > Git LFS > 파일 추적 / 중지하기 클릭

쉽게 관리 가능

이렇게 등록해 놓으면 git lfs track (filename)과 같은 작업을 하고 .gitattributes 파일도 자동으로 갱신해준다.

 

추가로 Git LFS 용량이 초과 되었을 때 무료로 해결하는 방법이 있다. (돈 아까우니깐)

DVC를 이용하는 것인데 초과 되었을때 사용해보도록 하겠다.
DVC 참고 블로그 : https://sbjjsurfing.tistory.com/110

 

Git LFS 무료 데이터 초과 문제 공짜로 해결하기 - DVC (Data Version Control)

이거 먼저 알고가자. GitHub Repository 는 코드만 저장하는 곳이지 대용량 데이터를 저장하는 곳이 아니다 데이터 사이언스 프로젝트를 진행하다 보면, 대용량 데이터를 다루는 경우가 많다. 초보들

sbjjsurfing.tistory.com

 

728x90
반응형

+ Recent posts