CS/기타

[기타] Gitlab에서 Github로 프로젝트 이동(mirroring)

코딩하는 포메라니안 2022. 10. 31. 22:42

1. 원본 저장소(Github repository)를 복사

git clone --mirror [원본_repository경로]

 

2. git폴더로 들어가기

cd [원본_저장폴더_이름].git

 

3. Github에 새로운 repository를 생성해서 넣기

git remote set-url --push origin [github_원격_repository_경로]
git push --mirror

 

+) 용량 큰 파일을 삭제했는데, 커밋 내역이 남은 경우

에러코드는 아래와 같이 뜬다.

github's recommended maximum file size of 50.00 mb

 

필요없는 파일이라, 해당 파일 관련 커밋 이력을 모두 삭제한 후 push한다.

git filter-branch -f --index-filter "git rm --cached --ignore-unmatch [용량_큰_파일명.확장자]" -- --all

 

15분 경과한 화면이다ㅠㅠ 생각보다 오래 걸리기 때문에 다음부턴 시간이 있을 때 해야겠다..