git

[Git] 외부 리포지토리 변경 사항 병합하는 법

연향동큰손 2025. 2. 1. 21:31

 

현재 나의 리포지토리 ==> web_project_woohyeon

최신 변경사항이 있는 리포지토리 ==> web_project_chung

 

나의 리포지토리를 외부 리포지토리와 병합하는 방법에 대해서 알아보자..

 

1. web_project_woohyeon 리포지토리 clone해오기

git clone https://github.com/cbnu-dev-O2O/web_project_woohyeon.git

 

 

2. web_project_woohyeon으로 이동

cd web_project_woohyeon

 

 

3. 리모트 주소 확인

git remote -v

 

 

4. woohyeon브랜치 생성 후 해당 브랜치로 이동

git checkout -b feature/woohyeon

 

 

5. 외부 리포지토리의 리모트 주소 추가

git remote add chung_repo https://github.com/cbnu-dev-O2O/web_project_chung.git

 

 

6. 리모트 주소 확인

git remote -v

 

 

7. chung_repo(web_project_chung)의 최신 변경 사항을 로컬 저장소로 가져오기

git fetch chung_repo

 

 

8. chung_repo/master(web_project_chung의 최신 master 브랜치)를 현재 브랜치에 병합

git merge chung_repo/master

성공