욤미의 개발일지

[Git] Fork한 Repository 최신 상태로 업데이트하기 본문

카테고리 없음

[Git] Fork한 Repository 최신 상태로 업데이트하기

욤미 2025. 1. 5. 16:58
728x90
반응형
1. 로컬(내 컴퓨터)로 Fork한 저장소를 clone 한다.
2. 로컬에 있는 포크 저장소에 원본 저장소를 리모트 설정해 준다.
3. 포크 저장소에 원본 저장소 내용을 머지한다.

1. 내 로컬에 포크 저장소 Clone하기

$ git clone https://github.com/Youngmi-Park/pseudo-lab-nnlabmlai

2. Clone 한 프로젝트의 리모트 저장소 확인

$ git remote -v
origin https://github.com/Youngmi-Park/pseudo-lab-nnlabmlai (fetch)
origin https://github.com/Youngmi-Park/pseudo-lab-nnlabmlai (push)

3. 리모트 저장소에 원본 저장소 추가

$ git remote add upstream https://github.com/Pseudo-Lab/pseudo-lab-nnlabmlai

4. 원본 저장소가 추가됐는지 확인하기

$ git remote -v 
origin hhttps://github.com/Youngmi-Park/pseudo-lab-nnlabmlai (fetch)
origin https://github.com/Youngmi-Park/pseudo-lab-nnlabmlai (push)
upstream https://github.com/Pseudo-Lab/pseudo-lab-nnlabmlai (fetch)
upstream https://github.com/Pseudo-Lab/pseudo-lab-nnlabmlai (push)​

5. 원본 저장소 fetch

$ git fetch upstream

6. 원본 저장소 내용 내 로컬로 merge

$ git merge upstream/master

7. 내 로컬에서 포크 저장소로 push

$ git push

 

 

반응형

 

728x90
반응형
Comments