IT
You may want to try Git Large File Storage - https://git-lfs.github.com
RailCoder
2023. 4. 20. 10:46
반응형
반응형
상황
100mb 이상의 파일을 GitHub에 올릴 때 에러가 발생합니다.
해결
lfs 설치해서 올리면 됩니다.
* GitHub setting에 들어가서 archives section 체크를 해줍니다.
설치 방법
1. git-lfs를 설치합니다.
# Ubuntu
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
# Mac
brew install git-lfs
# CentOS
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
sudo yum install git-lfs
2. Repository에 lfs를 적용합니다.
> git lfs install
# 이전에 해당 업로드 파일이 있으면 기록 제거를 합니다
> git rm -r --cached "*"
3. Repository 내에서 업로드 할 파일을 track 합니다.
> git lfs track "파일명"
4. .gitattributes와 함께 add, commit, push 합니다.
> git add .gitattributes
> git add "파일명"
> git commit -m "메세지"
> git push origin master
반응형