<git> git Fork한 Repository 최신화

MinsHouse·2022년 8월 8일
0

git Fork한 Repository 최신화???

-> 작업하기 위해 Fork 한 이후로 Base Repository에 commit들이 지속적으로 쌓일 것이고, 매번 Fork 하기에는 부담이 된다. 또한, 아래의 사진과 같이 Update를 권장하기도 한다. 😱

따라서, Fork한 Repository를 최신 버전으로 동기화하는 방법을 알아보겠습니다.😁

Base Repository: https://github.com/fosslight/fosslight
내가 Fork한 Repository인 https://github.com/MiniVee/fosslight 의 기본 branch인 develop을 최신화하겠습니다.

1. 내 PC로 다운로드한 폴더로 들어가서 remote 작업하기

저의 경우 fosslight 폴더 경로로 들어가겠습니다.

2. Base Repository를 지정하기

3. Base Repository의 최신 소스 가져오기

  • git fetch base

4. 최신 소스를 나의 Repository에 Merge 하고 Push하기

  • git checkout develop
  • git merge base/develop
  • git push origin develop
    이러면 최신 소스로 동기화가 완료된다!!!😎
    따라서, 아래 사진과 같이 이미 최신 상태임을 알 수 있다.

⭐️ 요약 ⭐️

  • 내 PC에서 Fork한 Repository 경로로 이동
    (cd Fork한 Repository경로)
  • git remote -v (Fork한 Repository를 origin이 되게 하기)
  • git remote add base BaseRepository 주소
    ex. git remote add base https://github.com/fosslight/fosslight.git
  • git remote -v (BaseRepository가 base가 됐는지 확인)
  • git fetch base
  • git checkout develop
  • git merge base/develop
  • git push origin develop

끝으으으으응ㅌ!!!!!👍

profile
MiniBee

0개의 댓글