-
Git - 포크한 깃허브 저장소를 원본 저장소와 동기화 하기Engineering WIKI/Version Control 2021. 4. 26. 11:34
* 원본 저장소의 변경 내용을 포크(fork)한 제 저장소에 반영할 때 사용.
- 로컬로 포크 저장소를 clone 합니다.
- 로컬에 있는 포크 저장소에 리모트를 설정해 줍니다.
- 포크 저장소에 원본 저장소를 머지합니다.
- 원본 저장소 => https://github.com/ax5ui/ax5ui-kernel
- 포크 저장소 => https://github.com/hyunjun19/ax5ui-kernel.git
// 포크 저장소를 로컬로 클론 $ git clone https://github.com/hyunjun19/ax5ui-kernel.git // 로컬 저장소로 이동 $ cd ax5ui-kernel // 현재 설정된 리모트 저장소 조회 $ git remote -v origin https://github.com/hyunjun19/ax5ui-kernel.git (fetch) origin https://github.com/hyunjun19/ax5ui-kernel.git (push) // 리모트 저장소 추가 $ git remote add upstream https://github.com/ax5ui/ax5ui-kernel // 리모트 저장소 확인 $ git remote -v origin https://github.com/hyunjun19/ax5ui-kernel.git (fetch) origin https://github.com/hyunjun19/ax5ui-kernel.git (push) upstream https://github.com/ax5ui/ax5ui-kernel (fetch) upstream https://github.com/ax5ui/ax5ui-kernel (push) // 리모트 저장소 fetch $ git fetch upstream remote: Counting objects: 793, done. remote: Total 793 (delta 692), reused 692 (delta 692), pack-reused 101 Receiving objects: 100% (793/793), 215.62 KiB | 144.00 KiB/s, done. Resolving deltas: 100% (717/717), completed with 127 local objects. From https://github.com/ax5ui/ax5ui-kernel ... // 리모트 저장소 merge $ git merge upstream/master Updating 9cdedc67..92c52dab Fast-forward ... // 포크 저장소로 push $ git push Counting objects: 791, done. Delta compression using up to 4 threads. Compressing objects: 100% (141/141), done. Writing objects: 100% (791/791), 212.18 KiB | 53.05 MiB/s, done. Total 791 (delta 710), reused 723 (delta 650) remote: Resolving deltas: 100% (710/710), completed with 99 local objects. To https://github.com/hyunjun19/ax5ui-kernel.git 9cdedc67..92c52dab master -> master
Reference : hyunjun19.github.io/2018/03/09/github-fork-syncing/
'Engineering WIKI > Version Control' 카테고리의 다른 글
Git - git reflog로 hard-reset되돌리기 (0) 2021.05.02 Git - 브랜치 추적 (1) 2021.04.26 SVN - Repository 생성 (0) 2021.04.15 SVN - 체크아웃 프로젝트 Maven 설정 (0) 2021.01.17 Eclipse SVN 제외 (1) 2021.01.17 10분만에 배우는 Git (0) 2018.09.10 Git 과 Github (11) (0) 2018.09.10 Git 과 Github (10) (0) 2018.09.10