협업 프로젝트나 오픈 소스 git 프로젝트를 clone한 경우,
해당 프로젝의 upstream 저장소에 대해 직접 push 할 수 있는 권한은 없을지라도
pull request 하기 위해 push 및 fetch 수행을 위한 설정이 필요합니다.
$ git remote -v
origin <remote-repo-address> (fetch)
origin <remote-repo-address> (push)
$ git remote set-url upstream <repository-address>
$ git remote upstream <repository-address>
$ git remote -v
origin <remote-repo-address> (fetch)
origin <remote-repo-address> (push)
upstream <repository-address> (fetch)
upstream <repository-address> (push)
위와 같이 뜨면 upsetream 등록 완료 !
$ git fetch upstream
이렇게 하면, upstream 브랜치에 반영되었던 사항이 모두 다운로드 받아진다.
내려받은 소스 코드를 내 repository에 merge 시켜준다.
$ git merge upstream
$ git push upstream
위 내용이 정확하지는 않습니다.
아직 git 이해도가 낮아 모든 flow를 이해할 순 없ㅈㅣ만...
개인 복기용으로 작성한 블로깅입니다.
정확하지 않은 부분이 있거나 추가되면 좋을만한 내용이 있다면
댓글 달아주세요 !
내 레포지토리는 origin이고, 원본 레포지토리는 upstream입니다! 보통 push는 origin에 하고 upstream에 pr을 날립니당