본문 바로가기

기록/기타

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

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

'기록 > 기타' 카테고리의 다른 글

파이썬 설치하기  (1) 2021.07.23
[Git] No projects found  (0) 2021.03.24
[Git] Fork와 Clone  (0) 2020.11.10
Eclipse) the import java.util cannot be resolved 오류  (0) 2020.03.06
Github) jackson-databind 알림  (0) 2020.03.05