[git] error: GH001: Large files detected.
git

[git] error: GH001: Large files detected.

git에 푸시 할 때 나타나는 에러 메시지 중 하나입니다. 일정 크기 이상(100MB)의 파일을 푸시하려고 할 때 나타나는 오류인 것으로 보입니다. 여러 가지 해결법이 있겠지만, 커맨드 라인에서 처리하는 방법을 취하였습니다.

 

git log	#깃 로그 확인

git reset --soft HEAD~1	#최근 커밋 내역 1개 삭제 / 필요에 따라 2~3개 이상의 커밋 내역 삭제

echo [잘못 업로드 된 파일 이름 혹은 폴더] >> .gitignore
# echo folder/ >> .gitignore
# echo abc.exe >> .gitignore

git add .gitignore

git rm --cached [잘못 업로드 된 파일 이름]
git rm -r --cached [잘못 업로드 된 폴더 이름]

git commit -m 'commit msg'
git push origin main

lfs라는 라이브러리? 툴?을 사용하여 해결하는 방법도 있는 것 같지만, 일단은 해당 방법으로 해결.