개발킹/Git

fork 해온 repository 최신화 하기

찌 ㅋ 2021. 3. 25. 09:30

1. 원본 repo 연결하기

git remote add {이름} {원본 repo}
git remote add upstream https://git.~~~

 

2. 연결이 잘 되었는지 확인

git remote -v

아래와 같이 나오면 연결 완.

origin {fork해온 내 repo} (fetch)
origin {fork해온 내 repo} (push)
upstream {원본 repo} (fetch)
upstream {원본 repo} (push)

 

3. 원본 repo 최신화

git fetch upstream

 

4. 원본 repo의 최신 내용과 내 로컬 repo를 merge

git merge upstream/{upstream의 브랜치}

내가 지금 위치한 브랜치와 merge를 해주는 것이기 때문에 현재 branch를 확인한 후에 해야 함

 

'개발킹 > Git' 카테고리의 다른 글

Git Repository commit 포함해서 이동하기  (0) 2021.03.23