반응형
원격저장소에 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 설치해주기
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
그리고 드디어 삽질 해결되었다.
반응형
'Git' 카테고리의 다른 글
Git - Vite와 React, pnpm 으로 github page 배포하기 (5) | 2024.08.25 |
---|---|
Git - Obsidian 메모앱과 깃헙 연동하기 (0) | 2024.08.13 |
Git - Remote Origin Already Exists 에러 해결하기 (3) | 2023.08.09 |
Git(39) 로컬 브랜치 덮어쓰기 (0) | 2023.02.09 |
Git(38) 삭제한 stash 복구 하기 (0) | 2022.07.19 |
댓글