fork 이후 변경된 original remote repo 내용 업데이트

Junghyun Park·2021년 7월 12일
0

배경 및 문제점

  • 최초 original (remote) repo로부터 fork 하여 개인 repo에 두고, 이를 local repo의 origin(remote repo명)으로 명명하고 pull/push 하고 있었음
  • 갑자기 협업자로부터 remote original repo에 새로운 branch가 생성되고, 이를 fetch 받아 테스트를 해야하는 상황
  • but, fork 받은 내 remote repo에 이와 같은 추가된 repo가 반영되지 않아, local로 pull(fetch)해올 수가 없었음

해결방법

fork한 나의 remote에 동일한 branch를 생성하고, original의 신규 branch와 동기화

create branch 메뉴를 통해 original 신규 branch 명과 동일하게 생성하니 자동으로 동기화 시켜 줌

실제 local에 동기화 되어 있는지 remote의 branch list 확인

git branch -r

local과 remote repo의 변경사항(branch 추가) 동기화

git remote update

local에 동일한 브랜치를 생성하고, remote의 동일 branch를 tracking

git checkout -t origin/dev-ble
: 신규 명령어(switch)로 조금 더 짧게 쓸 수 있다고 함

profile
21c Carpenter

0개의 댓글