728x90

깃(GIt) 사용시 현재 로컬 저장소(local repository)에 연결되어 있는 원격 저장소(remote repository)를 연결을 끊고 다시 연결 하는 방법을 간단히 포스팅 합니다.

 

먼저 git remote -v 명령어를 사용하여 현재 연결되어 있는 원격 레파지토리를 확인해 봅시다.

$ git remote -v
origin https://github.com/IfUwanna/Tool.git (fetch)
origin https://github.com/IfUwanna/Tool.git (push)

 

github 원격 저장소와 연결되어 있는 것을 확인 하실 수 있습니다. 해당 원격 저장소의 연결을 제거하기 위해서 git remote remove <name> 옵션을 사용해 주시면 연결되어 있는 저장소를 간단하게 끊을 수 있습니다. 

$ git remote remove origin

 

이후 다시 -v 옵션을 통해 확인해 보면 연결된 원격 저장소가 없는 것을 확인 하실 수 있습니다.

 

 

다시 원격저장소와 연결하고 싶으실 경우엔 git remote add <name> <url> 옵션을 사용하시면 됩니다.

$ git remote add origin https://github.com/IfUwanna/Tool.git

 

이외에도 git remote 명령어는 아래와 같이 원격 저장소에 대한 다양한 관리 기능을 제공하니 참고해 주세요. 

NAME git-remote - Manage set of tracked repositories SYNOPSIS git remote [-v | --verbose] git remote add [-t <branch>] [-m <master>] [-f] [--[no-]tags] [--mirror=<fetch|push>] <name> <url> git remote rename <old> <new> git remote remove <name> git remote set-head <name> (-a | --auto | -d | --delete | <branch>) git remote set-branches [--add] <name> <branch>... git remote get-url [--push] [--all] <name> git remote set-url [--push] <name> <newurl> [<oldurl>] git remote set-url --add [--push] <name> <newurl> git remote set-url --delete [--push] <name> <url> git remote [-v | --verbose] show [-n] <name>... git remote prune [-n | --dry-run] <name>... git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)...] DESCRIPTION Manage the set of repositories ("remotes") whose branches you track. OPTIONS -v, --verbose Be a little more verbose and show remote url after name. NOTE: This must be placed between remote and subcommand.

출처: https://ifuwanna.tistory.com/263 [IfUwanna IT]

출처: https://ifuwanna.tistory.com/263 [IfUwanna IT]

 

 



출처: https://ifuwanna.tistory.com/263 [IfUwanna IT]

+ Recent posts