전체 Git 리포지토리를 이동하는 방법
여러 Git 리포지토리 사이에서 고군분투하고 있다면 결국에는 리포지토리 간에 파일을 이동하고 싶을 것입니다. 이 자습서에서는 Git 리포지토리 전체를 하나의 원격 서버에서 다른 원격 서버로 이동하는 방법을 설명합니다. 아래 단계를 통해 어떤 브랜치와 태그를 포함할지 선택할 수도 있습니다.
원래 리포지토리를 ORI, 새 리포지토리를 NEW라고 부르겠습니다. ORI에서 NEW로 모든 것을 복사하기 위한 단계는 다음과 같습니다.
1. 다음을 사용하여 temp-dir 디렉터리에 로컬 리포지토리를 만듭니다.
git clone <url to ORI repo> temp-dir

2. temp-dir 디렉터리로 이동합니다.
3. ORI의 여러 브랜치 목록을 보려면 다음을 수행합니다.
git branch -a

솔루션 보기
Bitbucket Cloud에서 Git에 대해 알아보기

4. 다음을 사용하여 ORI에서 NEW로 복사하려는 브랜치를 모두 체크아웃합니다.
git checkout branch-name

5. 이제 다음을 사용하여 ORI에서 모든 태그를 가져옵니다.
git fetch --tags

6. 다음 단계를 수행하기 전에 다음 명령을 사용하여 로컬 태그 및 브랜치를 확인합니다.
git tag
git branch -a

7. 이제 다음 명령을 통해 ORI 리포지토리로 이동하는 링크를 지웁니다.
git remote rm origin
8. 다음 명령을 사용하여 로컬 리포지토리를 새로 만든 NEW 리포지토리에 연결합니다.
git remote add origin <url to NEW repo>
9. 다음 명령으로 브랜치와 태그를 모두 푸시합니다.
git push origin --all
git push --tags

10. 이제 ORI 리포지토리에서 전체 복사본을 갖게 되었습니다.
추가 사항
단순히 리포지토리 전체를 복사하고 싶은 경우 다음을 사용할 수 있습니다.
git clone --mirror <url to ORI repo> temp-dir
이는 1~5단계를 대체합니다.
이 문서 공유
다음 토픽
여러분께 도움을 드릴 자료를 추천합니다.
이러한 리소스에 책갈피를 지정하여 DevOps 팀의 유형에 대해 알아보거나 Atlassian에서 DevOps에 대한 지속적인 업데이트를 확인하세요.

Bitbucket 블로그

DevOps 학습 경로
