[Git] 6. 협업

문정준's avatar
Apr 17, 2025
[Git] 6. 협업
 

1. Organization 생성

 
notion image

2. Repository 생성

  • New Repository 생성
notion image
 
  • public으로 생성
notion image

3. 프로젝트 생성

notion image

4. 브랜치 보호

  1. master 브랜치에 push 권한 제어
  1. topic을 push해서 master에 merge 해도 돼?
      • 팀원은 Pull Request를 통해 push 요청
      • 팀원 중 1명이라도 승인하면 merge가 가능하게
 
  • Repository - Settings
notion image
 
  • Branches - Add classic branch protection rule 생성
notion image
 
  • Branch name pattern - master
notion image
 
  • Protect matching branches - Require a pull request before merging 체크
    • Require approvals : n명 이상의 찬성이 있으면 코드 push 가능
notion image
 

5. 팀원 초대

  • Add people → 팀원의 github ID 입력하여 초대
notion image
  • 초대를 받으면 등록된 email 혹은 github 내의 inbox에 알림
notion image

6. 협업 순서

  1. git checkout master : 메인 브랜치로 이동
  1. git pull origin master : 코드 수정사항 저장
  1. git checkout feat(기능 브랜치) : 작성하던 기능 브랜치로 이동
  1. git merge master : 코드 수정사항 반영 및 충돌 관리
  1. git push origin feat : 작성한 기능 업로드
  1. pull request : Reviewer가 체크 후 코드 merge
 
 
notion image
 
 
  1. pull request 체크
  • 컨벤션이 지켜지지 않은 경우, reject
  • 이상이 없으면 approve
notion image
 
  • Squash and merge
notion image
 
  • Merge Commit
    • Commit message에 [feat] 추가
    • confirm squash and merge
notion image
 

협업 순서 Reminding

  1. [팀장] 깃헙에 기관 하나 만들기
  1. [팀장] 레포지토리 생성
  1. [팀장] 프로젝트 세팅
      • 전체 패키지 생성 [.keep]
      • 6개 파일 만들고!! [C-S-R, Req, Resp, Entity]
      • GitHub push (Master)
  1. [팀장] 브랜치 보호
      • master 브랜치에 push 못하게 막기
      • topic을 push해서 팀장한테 master에 merge해도 돼?
      • 팀원 중 한 명이라도 승인해주면 merge 가능하게
  1. 팀원 초대
      • 콜라보 초대 admin 권한으로!
  1. 협업
      • 회원가입(join), user/회원가입
      • 로그인(login), user/로그인
      • 아이디중복체크(check), user/회원가입
      • 글목록보기(list) board/글목록보기
  1. 푸시 방법
      • topic 브랜치 commit
      • master checkout
      • master pull
      • topic checkout
      • master merge and conflict 해결
      • topic push
      • pr 요청 (리뷰어 선택)
      • [팀장] 스쿼시 머지
 
Share article

sxias