Day 3 - 원격과 Pull Request
GitHub 연동 · push/pull · PR · 코드 리뷰 흐름
목차
학습 목표
origin원격 이해- feature 브랜치를 원격에 올리고 PR 생성
- 리뷰 후 main 반영 흐름 설명
원격 저장소
# 클론
git clone https://github.com/<user>/<repo>.git
cd <repo>
# 원격 확인
git remote -v
# 기존 로컬에 원격 추가
git remote add origin https://github.com/<user>/<repo>.git
SSH 키 등록을 권장합니다 (ssh -T git@github.com).
push / pull
# 브랜치 첫 push
git push -u origin feature/login
# 이후
git push
git pull # fetch + merge
git fetch origin
git status
Pull Request
- feature 브랜치 push
- GitHub에서 Compare & pull request
- 제목/본문 (무엇을 · 왜 · 어떻게 검증했는지)
- 리뷰어 지정 → 승인 → Merge
- 로컬
main갱신
git switch main
git pull origin main
git branch -d feature/login # 로컬 정리
좋은 PR 메시지 예
feat: add login API
- POST /auth/login 추가
- 단위 테스트 포함
- 로컬에서 curl 검증 완료
실습
- GitHub에 빈 저장소 생성
- 로컬 프로젝트 연결 후
mainpush - feature 브랜치에서 README 수정 → PR → self-merge
- 로컬에서
git pull확인