본문 바로가기

Engineering/Architecture

Git Branch 네이밍 규칙

작업별 브랜치 네이밍 규칙

작업의 목적과 종류에 따라 브랜치 이름을 정하면, 프로젝트 관리가 쉬워지고 협업 시 혼란을 줄일 수 있습니다.

1️⃣ 기능 개발 (Feature)

📌 사용 예시: feature/<기능명>

📌 설명: 새로운 기능을 개발할 때 사용

feature/login-api
feature/user-profile-update
feature/cart-discount

2️⃣ 버그 수정 (Bugfix)

📌 사용 예시: bugfix/<이슈번호>-<수정내용>

📌 설명: 버그를 수정할 때 사용

bugfix/1234-login-error
bugfix/5678-ui-overflow
bugfix/api-timeout

3️⃣ 긴급 핫픽스 (Hotfix)

📌 사용 예시: hotfix/<긴급수정내용>

📌 설명: 운영(main) 환경에서 긴급하게 수정해야 할 때 사용

hotfix/payment-crash
hotfix/api-broken
hotfix/security-patch

4️⃣ 마이그레이션 (Migration)

📌 사용 예시: migration/<DB-수정내용>

📌 설명: 데이터베이스나 시스템 마이그레이션 작업을 위한 브랜치

migration/add-user-table
migration/update-product-schema
migration/refactor-db-index

5️⃣ 리팩토링 (Refactor)

📌 사용 예시: refactor/<리팩토링내용>

📌 설명: 코드 개선, 구조 변경, 성능 최적화 등의 작업

refactor/clean-auth-service
refactor/split-large-functions
refactor/improve-logging

6️⃣ 문서 작업 (Docs)

📌 사용 예시: docs/<문서작업내용>

📌 설명: README, API 문서, 가이드 문서 작성/수정 시 사용

docs/update-readme
docs/add-api-guidelines
docs/fix-typo

7️⃣ 실험 (Experimental)

📌 사용 예시: experiment/<실험내용>

📌 설명: 새로운 기술 테스트, 실험적인 기능 개발 시 사용

experiment/graphql-implementation
experiment/ai-integration
experiment/new-ui-framework

🚀 브랜치 네이밍 예시

유형 브랜치 이름 설명
기능 추가 feature/user-dashboard 사용자 대시보드 개발
버그 수정 bugfix/4321-login-issue 로그인 문제 해결 (이슈 ID 포함)
긴급 핫픽스 hotfix/server-crash-fix 서버 다운 긴급 수정
마이그레이션 migration/add-user-logs 유저 로그 테이블 추가
리팩토링 refactor/improve-auth-performance 인증 서비스 성능 개선
문서 작업 docs/update-api-docs API 문서 업데이트
실험 experiment/new-cache-system 새로운 캐시 시스템 테스트

 

네이밍 규칙 요약

  1. 일관된 접두어 사용: feature/, bugfix/, hotfix/, refactor/, docs/ 등
  2. 소문자 + 하이픈(-) 사용: feature/user-login, bugfix/fix-404-error
  3. 의미 있는 이름: feature/improve-dashboard → X feature/update
  4. 이슈 번호 포함 가능: bugfix/9876-payment-error
  5. 영어 사용 원칙: 코드 스타일과 통일성을 위해 영어 사용

'Engineering > Architecture' 카테고리의 다른 글

Git branch 전략(개인브랜치별)  (0) 2025.03.19
Git Branch 전략(기능별)  (0) 2025.03.19
Git PR 템플릿  (0) 2025.03.19
Git Commit 컨벤션  (0) 2025.03.19