본문 바로가기
Computer Science/Git

Synchronize the git fork repository to the latest version

by happy coding! 2018. 8. 20.
반응형

Synchronize the git fork repository 

to the latest version of origin repository






● 원본 repository 에서 업데이트된 부분을 받아올 때 


$ git remote -v

origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)

origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)



$ git remote add upstream

https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git



$ git remote -v

origin https://github.com/YOUR_USERNAME/YOUR_FORK.git  (fetch)

origin https://github.com/YOUR_USERNAME/YOUR_FORK.git  (push)

upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git  (fetch)

upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git  (push)



$ git fetch upstream

* [new branch]  master -> upstream/master



$ git checkout master



$ git merge upstream/master



$ git push origin master





[참조] https://json.postype.com/post/210431

반응형

댓글