Git

[GitHub] 브랜치 덮어 씌우기

탱젤 2021. 3. 4. 13:24

변경된 Upstream branch를 develop branch로 덮어씌우기 (최신상태를 pull)

  1. upstream을 remote로 등록
  2. upstream 내용 fetch
  3. develop branch와 upstream 병합 -> 여기까지 하면 내 코드가 최신 코드로 바뀜
  4. 다음 작업을 위해 지금 develop branch를 push
git remote add upstream "upstream git 주소"
git fetch upstream
git merge upstream/develop
git push origin develop

(merge는 upstream이 최신 상태가 되었다는 뜻, 나와 협업자들은 이 최신의 upstream을 다시 pull받아 최신 환경에서 새롭게 작업해야함)


참고: medium.com/@yms0214/git-%ED%98%91%EC%97%85%ED%95%98%EA%B8%B0-upstream-merge-%ED%9B%84-%EC%B5%9C%EC%8B%A0%EC%83%81%ED%83%9C-pull-%EB%B0%9B%EA%B8%B0-213bc2c1c249

 

깃 브랜치 종류 설명글(나중에 다시 보기): gmlwjd9405.github.io/2018/05/11/types-of-git-branch.html

 

728x90