본문 바로가기

프로그래밍/개발환경

Github에서 포크한 repository에 최신 커밋 반영하기

아래와 같은 알림이 뜰 때가 있습니다.

This branch is 1 commit behind master.

 

 

로컬에서 다음과 같이 작업합니다.

$ git remote -v //upstream이 등록돼있는지 확인합니다.
$ git remote add upstream [git주소] //아니라면 upstream을 등록합니다.
$ git pull upstream //또는 git fetch upstream
$ git merge upstream/master
$ git push

 

 

성공적으로 완료되면 알림이 바뀝니다.

This branch is even with master.