DevelopmentTools/Git
[Git] PR Merge 이후 동기화
수짱수짱
2022. 8. 22. 01:24
1. master branch로 이동
git checkout master
2. 원본 저장소(upstream)에서 동기화
git pull upstream master
# git pull [원본저장소] [브랜치명]
3. Fork한 나의 원격 저장소에 동기화 내용 반영
git push origin master
4. 로컬 브랜치 삭제
git branch -D [브랜치명]
4-1. 원격 브랜치도 함께 삭제
git push origin --delete [브랜치명]
협업을 위해 git remote 명령어로 원격 저장소에 연결을 할 때 2개의 원격 저장소에 연결해야 한다.
- 첫번째는 내가 fork하기 전 원본 원격 저장소 ( 보통 upstream , 위에서 흐른다는 의미 )
- 두번째는 내가 fork해온 나의 원격 저장소 ( 보통 origin )
참고: https://velog.io/@backtony/Git-fork-pull-request-%ED%98%91%EC%97%85%ED%95%98%EA%B8%B0