본문 바로가기
Git

[Git] Repository 복사하기

by 오늘도 756 2021. 8. 5.

git을 이용해서 타계정 소스코드를 자신의 저장소에 복사하는 방법을 알아보겠습니다.

 

우선, 복사할 Repository와 저장할 Repository 주소 값을 알아야 합니다.

아래는 예시 입니다.

복사할 Repository 주소 : https://github.com/jangareum03/old.git
저장할 Repository 주소 : https://github.com/jangareum03/new.git

1. git clone --mirror https://github.com/jangareum03/old.git

2. cd oId.git

3. git remote set-url --push origin https://github.com/jangareum03/new.git 

4. git push --mirror

 

위의 명령어를 입력하면 자신의 저장소에 복사가 되며, 모든 branch 별 commit 및 tag 내용 그대로 복사가 됩니다.

 

혹은 github에서  repository를 복사하고 싶다면, 복사하고자 하는 Repository에서 우측 상단 fork버튼을 선택하면 됩니다.

'Git' 카테고리의 다른 글

[GitHub] STS에 GitHub 연결하기  (0) 2021.08.06

댓글