umc(앱 런칭 동아리)에서 본격적으로 다른 개발자와의 협업을 시작했다.
협업으로는 처음이라 많이 헷갈린다. 정리해두고 헷갈릴때마다 꺼내보자!
개요
1. clone, remote
2. branch 생성
3. 생성한 Branch를 push
github repository를 내 local로 clone한다.
git clone (github에서 복사한 주소)
현재 위치한 branch 확인
git branch
원격 저장소의 branch 확인
git branch -r
git branch (생성할 branch 이름)
생성됨을 확인 했으니, 생성한 branch로 이동
(브랜치 이동을 하기 전에 꼭 pull을 받도록..!)
git checkout (이동할 branch)
git push
로컬 레포에는 branch가 있지만 원격 레포에는 branch가 없는 상태 이므로, 처음 push할때는 다음과 같이 설정해줘야 한다.
git push --set-upstream origin (branch)
git push -u origin (branch)
(둘중 아무거나 사용하면 됨)
shinhyeon branch가 추가된 모습
참고
https://wayhome25.github.io/git/2017/07/08/git-first-pull-request-story/
https://goddaehee.tistory.com/274