본문 바로가기
Git

Git - 실행오류 this exceeds GitHub's file size limit of 100.00 MB

by 새발개발JA 2024. 8. 7.
반응형

 

원격저장소에 100mb 가 넘는 파일을 push 하려고 했더니 다음과 같은 에러 메시지가 나왔다

깃헙에서는 100mb  가 넘는 파일 업로드가 제한되는데, 이때 Github Large File Storage  를 활용하면 해결이 가능하다

remote: error: Trace: d183cdc7e4067f908b9401bde
remote: error: See https://gh.io/lfs for more information.
remote: error: File Obsidian.exe is 168.57 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/-/obsidian-custom.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/-/obsidian-custom.git'

 

 

 

 

1. 일단  LFS 를 설치해주자. Git Large File Storage  설치해주기

 

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

 

 

 

2. 다시 커밋을 해주고 푸시해준다.

(혹시 해당 .gitattributes  나  대용량 파일이 커밋이 되있다면  커밋 이전으로 되돌려주자) 

push가 안되는 대용량 파일은  exe 파일이므로, exe 파일을 lfs 에 tracking 해주면 .gitattributes 파일에 내용이 저장된다.

git lfs track "*.exe"  # exe 파일을 lfs 리스트에 올려주고
git add .gitattributes # lfs에서 처리할 파일의 목록이고
git add Obsidian.exe   # 사건의 주범과 같이 staging 해준다
git commit -m "Track exe file with Git LFS" # 커밋 넣어주고
git push origin main # push  때려준다



3. 만약에 그래도 push error  가 난다면, migrate 명령어를 돌려준다. 

 git lfs migrate import --include="*.exe" 
 git push origin main

 

 

그리고 드디어 삽질 해결되었다.

 

 

 

 

 

반응형

댓글