개발하고 있는 어플의 안드로이드측 API 연결 계획이 많이 지연되어서
현재 개발 완료된 API 중에 필수 API만 선별하여 ver.1으로 출시할 예정이다.
따라서 기존 repository와 배포용 repository를 구분해야 했다.
로컬에서 파일을 그대로 복사하자니 commit 기록들이 다 날라가기 때문에
git으로 repository 복사하는 방법을 찾아보았다.
새로운 repository INFRA-Server-ver1.0 을 만들고
기존 repository INFRA-Server 의 특정 branch인 version1.0 을 복사해와야 하는 상황이다.
git clone --mirror { git repository 주소 }
나의 경우는 기존 repository의 특정 브랜치를 새로운 repository에 옮겨야 하므로 아래 명령어를 사용했다.
git clone -b { 브랜치명 } --single-branch --mirror { git repository 주소 }
clone을 정상적으로 완료했다면 repository명.git 파일이 생성되어 있을 것이다.
mv repository명.git .git
cd .git
git remote set-url origin { 새로운 repository 주소 }
git push --mirror
아 참고로 repository 주소는 github - repository창 - code 에서 확인할 수 있다.
https://velog.io/@hoo00nn/Git-Repository-%EB%B3%B5%EC%82%AC%ED%95%98%EA%B8%B0