본문 바로가기

Back-end/형상관리

[ Git ] Git 이관 (원격 저장소 URL 변경)

 

 

 

 

 

🔖 Git 이관 

 

A Git에서 B Git으로 History 포함하여 이관 작업 

 

 

PC에 git이 설치 되어있지 않다면 먼저 설치 진행

https://git-scm.com/downloads

 

Git - Downloads

Downloads macOS Windows Linux/Unix Older releases are available and the Git source repository is on GitHub. GUI Clients Git comes with built-in GUI tools (git-gui, gitk), but there are several third-party tools for users looking for a platform-specific exp

git-scm.com

 

 

이관 후 workspaces 를 잡을 예정이기 때문에 

삭제하기 편한 곳에 다 작업할 폴더 생성 후 cmd 창 열고, 

 

해당 폴더로 이동 

cd [작업 폴더]

 

 

 

기존 A git 클론 진행

git clone [A git http]

 

A Git 계정 확인 후 클론 진행 됨

 

 

 

완료 후 프로젝트 폴더로 이동 

cd [프로젝트 폴더명]

 

 

 

이관할 B Git 저장소로 변경

git remote set-url origin [B git http]

 

 

 

 

연결된 원격 저장소 확인

git remote -v

 

B git 저장소 확인 

 

 

 

프로젝트를 B Git 저장소로 Push 

git push -u origin --all

 

B Git 계정 확인 후 push 진행 됨 

 

 

 

태그가 있는 경우 태그 Push

git push --tags

 

 

 

B Git 확인시 history 포함하여 이관이 완료 된 것을 볼 수 있다 

작업 폴더는 삭제해도 무관