[git] github 레포지토리 복사 ( 커밋 이력 포함 )

제이브로·2025년 1월 15일
0

git

목록 보기
9/11
post-thumbnail

1. github 레포지토리 복사

새로운 레포지토리를 만들때, 기존 레포지토리를 복사해서 가져오는데, 커밋 이력까지 전부 가져오고 싶을 경우입니다.

1.1 git clone old repository

아무 폴더에 기존 레포지토리(old_repository)를 git clone한다.

git clone --bare https://github.com/Library/old_repository.git

1.2 cd old_repository.git

cloneold_repository.git 폴더로 이동한다.

cd old_repository.git

1.3 new repository

깃허브 홈페이지에서 새로운 레포지토리(new_repository)를 만든다.

1.4 git push

git push할때, --mirror 옵션을 추가해서 푸시한다.

git push --mirror https://github.com/Library/new_repository.git

감사합니다.

profile
기록하지 않으면 기록되지 않는다.

0개의 댓글