새로운 레포지토리를 만들때, 기존 레포지토리를 복사해서 가져오는데, 커밋 이력까지 전부 가져오고 싶을 경우입니다.
아무 폴더에 기존 레포지토리(
old_repository
)를git clone
한다.
git clone --bare https://github.com/Library/old_repository.git
clone
한old_repository.git
폴더로 이동한다.
cd old_repository.git
깃허브 홈페이지에서 새로운 레포지토리(
new_repository
)를 만든다.
git push
할때,--mirror
옵션을 추가해서 푸시한다.
git push --mirror https://github.com/Library/new_repository.git
감사합니다.