[Git] Git LFS로 Large File Upload

최승원·2022년 2월 8일
0

TIL (Today I Learned)

목록 보기
6/21

현재 repository의 sub directory에 large file이 있어서 업로드 해야 되는 경우 어떻게 해야되는지 정리해보았다.

git lfs 다운로드

Git Large File Storage
위의 링크에서 git lfs를 먼저 다운로드 받는다.

git lfs install

git lfs install

lfs를 설치하려고 하는 repository에 해당 명령어를 입력하여 lfs를 적용한다.

git lfs track

git lfs track repository/**/*.exe

lfs로 관리할 파일을 track한다. 이 때 서브 디렉토리의 path를 그대로 입력한다.

git add .gitattributes

git add .gitattributes

위의 과정을 거치면 해당 파일의 내용이 lfs pointer로 바뀌어 있는 것을 확인할 수 있다. 이 때, lfs로 트래킹한 파일에 대한 정보는 .gitattributes을 통해서 관리가 되기 때문에 이를 꼭 add해줘야 한다.

git push

git add repository/**/*.exe
git commit -m "large file uploaded"
git push

이후 기존의 git 사용법과 똑같이 push하면 된다.

참조

Git LFS (Large File Storage) 사용하기

profile
문의 사항은 메일로 부탁드립니다🙇‍♀️

0개의 댓글