기록/기타

[Github] github repository clone & 특정 커밋 버전으로 가져오기

3. 2020. 8. 23. 16:10
SMALL

다른 사용자의 소유의 repository 자체를 내 git으로 복제하는 방법이다.

commit내역까지 전부 개인 저장소로 복제하는 방법이다.


1. 복제할 repository 주소 가져오기

git clone --mirror repository 주소

 

2. 복제 받을 개인 repository 만들기

github 페이지에서 새 repository를 만들고, 저장소의 주소를 복사

git remote set-url --push origin 새 repository 주소

 

3. 복제하기 (push)

cd명령어로 코드가 있는 곳으로 이동한다.

git push --mirror

 

 


특정 커밋 버전 가져오기 (repository clone 전제)

1. 원본 깃의 가져올 특정 커밋의 버전 복사하기

 

2. 특정 커밋 버전으로 업데이트하기

git reset --hard (복사한 commit ID)

SMALL