반응형
빗버킷 쓰다가 깃헙으로 저장소를 이관해야 하는 일이 생겼다👍
커밋 내역과 메세지를 포함하여 통째로 이관하고 싶었다
서치해서 인터넷에 있는 내용을 고대로 따라 했는데 아래와 같은 에러 메세지가 났다.
용량이 100MB가 넘어서 안된다는 내용이다.
remote: error: File 파일경로 is 349.11 MB; this exceeds GitHub's file size limit of 100.00 MB
첫번째 시도로 git-lfs 를 시도하였으나
잘 안되서 git-filter-repo 를 시도하였고,
git-filter-repo 으로 해결되었다!
나중에 참고하기 위하여 사용한 명령어를 나열하여 적는다.
여기에서 git-lfs 부분은 안해도 잘 동작하지 않을까 싶다.
git clone --mirror https://계정명@bitbucket.org/repo_name.git
mv repo_name.git/ mirror-repo_name.git/
mkdir repo_name
cd repo-name/
git clone ../mirror-repo_name.git/ .git remote set-url --push origin https://github.com/repo_name.git
# git-lfs 시도 ( git push시에 실패함 )
# 맥이고 홈브루 사용중이라 brew 명령어 씀
brew install git-lfs
git lfs install
find . -type f -size +100M
# 위 명령어에서 찾은 100M보다 용량이 큰 파일의 경로를 작성
git lfs track "[file_path]"
git add .gitattributes
git commit -m "Track large files with Git LFS"
git status
git remote set-url --push origin https://github.com/repo_name.git
# git-filter-repo 시도 (성공!)
brew install git-filter-repo
git filter-repo --force --path [file_path] --invert-paths
git remote add origin https://github.com/repo_name.git
git remote -v
git remote set-url --push origin https://github.com/repo_name.git
git push --all origin
git status
용량 이슈가 없다면 아래 명령어로만 해도 될 듯 싶다..
물론 계정 인증은 별개로 또 해야함!
# 빗버킷 저장소 로컬로 가져옴
git clone --mirror https://계정명@bitbucket.org/repo_name.git
mv repo_name.git/ mirror-repo_name.git/
mkdir repo_name
cd repo-name/
git clone ../mirror-repo_name.git/ .git remote set-url --push origin https://github.com/repo_name.git
# push할 레포를 새로 만든 깃헙 레포로 설정
git remote set-url --push origin https://github.com/repo_name.git
# 푸시 !!
git push --all origin
git status
깃헙 계정 인증은 아래 링크에서 도움 얻어서 해결!!😎
(토큰 발급받아서 인증)
반응형
'IT지식' 카테고리의 다른 글
| JSP 개요 (0) | 2025.11.22 |
|---|---|
| 파이썬 얕은 복사, 깊은 복사 (0) | 2025.06.30 |
| 파이썬 파일명, 확장자, 경로 추출 - os 라이브러리 splitext, split 함수 (0) | 2025.03.02 |
| 파이썬 딕셔너리(dict) 메소드 (update, del) (0) | 2025.03.02 |
| 인텔리제이 디버깅 사용 방법 (0) | 2025.02.16 |