Github에 100MB 이상 파일 업로드

Suyeon·2022년 4월 17일
0

Etc

목록 보기
8/8

파일을 github에 push하려는데, 아래와 같은 에러를 마주쳤다.
내가 올리려면 파일은 123mb였는데 100mb가 넘어가서 아래의 에러가 발생한 것이였다.

remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.

이러한 경우, git-lfs을 사용하여 용량이 큰 파일(100mb~)을 원격 저장소에 올릴 수 있다.

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

// 2. 폴더(source code)로 이동하여 lfs 설치
git lfs install

// 3. 용량이 큰 파일 등록
git lfs track [FILE_NAME]

// 4. 원격 저장소에 push 
git add .gitattributes
git add [FILES]
git commit -m [COMMIT_MESSAGE]
git push origin main

참고

  • git-lfs: Git Large File Storage
  • lfs로 트래킹되는 파일은 .gitattributes를 통해서 관리된다.
  • 이전에 git add를 하여 stage area에 있는 파일이 있다면, git rm -r --cached "*" 커맨드를 사용하여 클리어한다.
profile
Hello World.

0개의 댓글