또 다른 이름으로 remote를 추가 해 줍니다. second 라는 이름으로 추가 한다고 가정하면 아래 명령어 처럼 입력합니다.
git remote add second git@github.com:Shane-Park/playddit.git
git remote rename origin old-origin git remote add origin git@github.com:Shane-Park/playddit.git git push -u origin --all git push -u origin --tags
git remote remove origin git remote add origin git@github.com:Shane-Park/playddit.git
저는 기존의 원격 저장소가 필요 없어서 3번을 선택 했습니다. 여러개의 원격 저장소가 추가된다면 혼동이 올 수도 있습니다.
그냥 git push를 했더니 upstream branch가 설정되어있지 않기 때문에 에러가 발생했습니다.
git push
% git status On branch master nothing to commit, working tree clean % git push fatal: The current branch master has no upstream branch To push the current branch and set the remote as upstream, use git push --set-upstream origin master %
git push -u origin master # -u 옵션은 local repository의 branch를 local repository branch에 연결하기 위한 것, 처음 한번만 쓰면 된다. # -u 옵션을 붙이면 다음부터 git push 명령만으로 원격 저장소의 master 브랜치에 커밋을 올릴 수 있다.
어렵다.