Development/기타
Git 디렉토리에 등록된 원격 저장소(Remote Repository) 주소 변경하기
Bryan_
2019. 7. 17. 20:23
반응형
Tested: Windows 10 (Git Bash), Ubuntu 16.04 (git)
현재 컴퓨터의 로컬 폴더에 있는 git 저장소가 가리키고 있는 (등록되어 있는) 리모트 저장소(remote repository) 이름과 URL을 확인한다:
$ git remote -v
$ git remote -v
origin https://aaa.bb/ccc.git (fetch)
origin https://aaa.bb/ccc.git (push)
특정한 별칭에 대하여 등록된 리모트 저장소의 주소를 변경하는 방법은 두 가지가 있다.
(1) 기존의 별칭으로 등록된 리모트 저장소의 주소를 변경하기 (set-url)
$ git remote set-url [별칭] [URL]
예:
$ git remote set-url origin https://eee.ff/ccc.git
(2) 기존의 별칭으로 등록된 리모트 저장소를 삭제하고 새로 추가하기
$ git remote remove [별칭]
$ git remote add [별칭] [URL]
예:
$ git remote remove origin
$ git remote add origin https://eee.ff/ccc.git
반응형