git upstream 원격 저장소 설정하기

ohyujeong·2023년 5월 9일
0

git

목록 보기
1/2
post-thumbnail

repository fork하기

먼저 가져오려고 하는 repository를 fork 한다. (github 화면의 우측 상단에 위치함) fork를 마치면 나의 repository에 fork된 repository가 생성된다.

fork한 repository를 clone하기

나의 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)

upstream 원격 저장소 설정하기

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)
profile
거친 돌이 다듬어져 조각이 되듯

0개의 댓글