일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- 윈도우우분투
- 이중우선순위큐
- 커밋옮기기
- JsonObect
- 백엔드
- gitlab
- window
- 의존성주입
- 싸피
- pymysql
- RequiredArgsConstructor
- 프로젝트회고록
- UnsupportedOperationException
- 프로시저
- github
- treeset
- SQL
- 추가합격
- BOJ
- SSAFY #싸피 #7기 #합격 #개발
- BFG
- IntelliJ
- mybatis
- 삼성 #교육 #개발자 #웹
- SSAFY
- tmehz
- commit
- 면접합격
- Java
- 백준
- Today
- Total
데굴데굴 굴러가는 개발 블로그
GitLab 에서 Github로 commit 까지 clone 하는법 본문
프로젝트를 gitlab에서 진행하고 github에다가 커밋 기록(잔디) 까지 가져오고 싶어서 별 노력을 다하다가 계속 안되길래 모든 인터넷의 해결법을 모아서 정리해보도록 한다..
대략적인 순서는 다음과 같다
1. Git lfs와 BFG Repo Cleaner 설치
https://rtyley.github.io/bfg-repo-cleaner/
BFG Repo-Cleaner by rtyley
$ bfg --strip-blobs-bigger-than 100M --replace-text banned.txt repo.git an alternative to git-filter-branch The BFG is a simpler, faster alternative to git-filter-branch for cleansing bad data out of your Git repository history: Removing Crazy Big Files Re
rtyley.github.io
Git Large File Storage
Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.
git-lfs.github.com
2. 옮기고자 하는 저장소(GitLab) mirror clone
git clone --mirror ${gitlab_저장소_주소}
3. 커밋 히스토리에서 100MB 넘는 file 찾아서 tracking ( .확장자 로 파일을 찾게 함)
git filter-branch --tree-filter 'git lfs track "*.{확장자1,확장자2...}"' -- --all
ex) git filter-branch --tree-filter 'git lfs track "*.{zip,jar,mp4,sql}"' -- --all
4. BFG를 이용해 3번에서 찾은 대용량 파일들을 Git lfs 변경
java -jar ${BFG_Repo_Clener_경로} --convert-to-git-lfs '*.확장자'
ex) java -jar ${BFG_Repo_Clener_경로} --convert-to-git-lfs '*.zip'
5. 새 저장소(Github)로 mirror -push
cd ${gitlab_repository}
git push --mirror ${github_주소}
ex) cd old-repository
git push --mirror https://new-repo.git
(위의 과정으로도 해결이 안된다면 해야하는 작업 -> 100M 이상 파일 + commit 기록까지 지워버리기)
java -jar bfg.jar --strip-blobs-bigger-than 100M
'개발 > 프로젝트' 카테고리의 다른 글
Vue router-link 에 @click 이벤트 적용 (0) | 2022.05.25 |
---|---|
Python을 이용한 SQL Database 다루기 (0) | 2021.04.06 |