Git - Fork 한 repository 최신으로 동기화하기
개발일지/CI & CD - Git, Jenkins

Git - Fork 한 repository 최신으로 동기화하기

안녕하세요?
github에서 fork한 repository를 최신으로 동기화하는 방법을 살펴보도록 하겠습니다.

먼저 remote url 확인

$ git remote -v
origin  https://github.com/frozenrainyoo/settings (fetch)
origin  https://github.com/frozenrainyoo/settings (push)

upstream 추가

fork한 부모 repository 주소를 remote에 등록합니다.

$ git remote add upstream https://github.com/jglee1027/settings

remote 다시 확인

$ git remote -v
origin  https://github.com/frozenrainyoo/settings (fetch)
origin  https://github.com/frozenrainyoo/settings (push)
upstream        https://github.com/jglee1027/settings (fetch)
upstream        https://github.com/jglee1027/settings (push)

fetch upstream

$ git fetch upstream
remote: Enumerating objects: 189, done.
remote: Counting objects: 100% (189/189), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 814 (delta 187), reused 188 (delta 187), pack-reused 625
Receiving objects: 100% (814/814), 150.02 KiB | 0 bytes/s, done.
Resolving deltas: 100% (226/226), completed with 26 local objects.
From https://github.com/jglee1027/settings
 * [new branch]      master     -> upstream/master

origin/master에 upstream/master를 머지합니다.

$ git merge upstream/master

끝 입니다.

반응형