100MB를 넘어가는 크기의 파일을 지닌 저장소(레포지터리) 미러링하기
가. Git LFS(Large File Storge)와 BFG Repo Cleaner를 설치합니다.
나. 복사하고자 하는 저장소(GitLab)의 clone을 생성합니다.
예제 사용자 이름을 저장소를 소유한 사람 또는 조직의 이름으로 변경
하고 예제 저장소 이름을 복제하려는 저장소 이름으로 변경합니다.
$ git clone --mirror https://gitlab.com/exampleuser/old-repository.git
다. 커밋 히스토리 내에서 Large File Storage을 찾아 트랙킹 합니다.
$ git filter-branch --tree-filter 'git lfs track ".{zip,jar}"' -- --all
라. BFG를 이용하여 해당 파일들을 git lfs로 변경합니다.
$ java -jar ~/usr/bfg-repo-cleaner/bfg-1.13.0.jar --convert-to-git-lfs '.zip'
$ java -jar ~/usr/bfg-repo-cleaner/bfg-1.13.0.jar --convert-to-git-lfs '*.jar’
마. 새로운 저장소(GitHub)로 mirror-push를 진행합니다.
$ cd old-repository.git
$ git push --mirror https://github.com/exampleuser/new-repository.git
바. 이전에 생성한 임시 로컬 레포지토리를 제거합니다.