0x012 Etc

[Git] Fork한 Repository 최신으로 동기화 하는 방법

KimSangLab 2019. 6. 3. 20:00

Fork한 Repository 를 최신으로 동기화하는 방법은 다음과 같다. 

 

 1. 원본 Repository 를 Remote Repository 로 추가 해야한다. 

  => git remote add [Repository Name] [Repository Address]

  => git remote -v 로 등록된 Repository 목록을 확인 할 수 있다. 

 

2. git fetch 명령을 통해 최신 내용을 가져온다. 

  => git fetch [Repository Name] 

 

3. 최신 내용을 master branch 또는 원하는 branch로 merge 한다. 

  => git checkout [branch name] (merge 할 branch를 변경 하고 싶은 경우 사용)

  => git merge [Repository Name]/[Branch] 

 

4. 위 내용은 Local Repository에 적용한 것이므로 push 를 통해 Remote Repository에도 적용 시켜주어야 한다. 

  => git push [Repository Name]