gitlab에서 했던 프로젝트를 github로 옮기려고 했다.
프로젝트 코드 + commit 메시지 내역 등을 한 번에 옮기려고 했는데 문제가 생겼습니다.
remote: Resolving deltas: 100% (4812/4812), done.
remote: error: Trace: c8115ed37ee052ccbf0cf957bece41a44fba9432fe67faaec0d40e60acd29827
remote: error: See https://gh.io/lfs for more information.
remote: error: File python/kcelectra_sentiment/model.safetensors is 416.14 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To https://github.com/kobenlys/Jippy.git
! [remote rejected] main -> main (pre-receive hook declined)
error: 레퍼런스를 'https://github.com/kobenlys/Jippy.git'에 푸시하는데 실패했습니다
파이썬 모델파일 용량이 416MB라서 github에 푸시하는데 실패했습니다.
이유는 github에서 push시 100mb 제한을 두고 있었기 때문입니다.
이를 해결하는 과정을 남겨보겠습니다.
brew install git-filter-repo
brew install git-lfs
git filter-repo --path python/kcelectra_sentiment/model.safetensors --invert-paths
# lfs 초기화
git lfs install
# LFS 설정 트래킹 할 파일 지정
git lfs track "python/sentiment/model.safetensors"
# .gitattributes 추가 후 커밋
git add .gitattributes
git add python/kcelectra_sentiment/model.safetensors
git commit -m "chore: using lfs"
# push 하기
git push origin main
commit 히스토리에는 100mb되는 파일을 제거하고 가장 마지막 커밋의 파일만 LFS로 관리하면 된다. 😋