# git
git init
git remote add
이 명령어는 두가지 인수를 사용합니다.
git remote add [원격 이름] [원격 저장소 URL]
git remote add origin https://github.com/USER/REPO.git
원격 원본이 존재한다면 이러한 에러를 만날 수 있습니다.
git remote add origin https://github.com/octocat/Spoon-Knife.git
fatal: remote origin already exists.
해결 방법
1. 다른 원격 이름 사용
2. 기존 원격 저장소 이름 변경
3. 기존 원격 저장소 삭제
git remote set-url
이 명령어는 두가지 인수를 사용합니다.
git remote set-url [원격 이름] [원격 저장소 URL]
git remote set-url origin
# HTTPS 사용시
https://github.com/USERNAME/REPOSITORY.git
# SSH 사용시
git@github.com:USERNAME/REPOSITORY.git
$ git remote -v
# View existing remotes
> origin https://github.com/OWNER/REPOSITORY.git (fetch)
> origin https://github.com/OWNER/REPOSITORY.git (push)
git remote rename
이 명령어는 두가지 인수를 사용합니다.
$ git remote rename origin destination
# Change remote name from 'origin' to 'destination'
$ git remote -v
# Verify remote's new name
> destination https://github.com/OWNER/REPOSITORY.git (fetch)
> destination https://github.com/OWNER/REPOSITORY.git (push)