먼저 가져오려고 하는 repository를 fork
한다. (github 화면의 우측 상단에 위치함) fork를 마치면 나의 repository에 fork된 repository가 생성된다.
나의 local에 fork한 repository를 clone한다.
$ git clone https://github.com/ujeongoh/devcombine.git
아래 커맨드로 현재 원격저장소 이름을 확인한다. 현재는 upstream이 없는 상태이다.
$ git remote -v
-----------------------------------------------------------
origin https://github.com/ujeongoh/devcombine.git (fetch)
origin https://github.com/ujeongoh/devcombine.git (push)
fork를 한 원 repository의 https 주소를 가져와 원격 저장소로 설정한다.
$ git remote add upstream https://github.com/devcombine/devcombine.git
입력 후 아무일도 일어나지 않는다면 성공이므로 원격저장소가 잘 설정되었는지 확인한다.
$ git remote -v
-----------------------------------------------------------
origin https://github.com/ujeongoh/devcombine.git (fetch)
origin https://github.com/ujeongoh/devcombine.git (push)
upstream https://github.com/devcombine/devcombine.git (fetch)
upstream https://github.com/devcombine/devcombine.git (push)