Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Git Branch & Merge μ „λž΅

cheon-eunjeong edited this page Jul 12, 2023 · 5 revisions

Git Branch & Merge μ „λž΅

βœ… Git Flow

  1. Issue (μž‘μ—… ν‹°μΌ“) 생성
  2. develop λΈŒλžœμΉ˜μ—μ„œ Issue λ‹¨μœ„λ‘œ μž‘μ—… 브랜치 생성
    a. κΈ°λŠ₯ 개발 : feature/{μž‘μ—…μ΄λ¦„}-{이슈번호} (e.g. feature/social-123)
    b. ν•«ν”½μŠ€ : hotfix/{μž‘μ—…μ΄λ¦„}-{이슈번호} (e.g. hotfix/social-123)
  3. ν•΄λ‹Ή λΈŒλžœμΉ˜μ— 컀밋 μž‘μ„± πŸ’»
  4. μž‘μ—… 브랜치 -> develop으둜 PR μš”μ²­
    a. νŒ€μ›λ“€μ˜ 리뷰 및 Approve
  5. μž‘μ—… 브랜치 -> develop PR MergeλŠ” Squash & Merge μ‚¬μš©
  6. develop -> main PR μš”μ²­
    a. front-end와 back-end의 κΈ°λŠ₯이 λͺ¨λ‘ μ˜¨μ „νžˆ μ‹€ν–‰λ˜λŠ”μ§€ ν…ŒμŠ€νŠΈ
  7. develop -> main PR MergeλŠ” Create merge commit μ‚¬μš©

Git Branch

%%{init: { 'theme': 'base', 'gitGraph': {'showBranches': true, 'showCommitLabel': false } } }%%
gitGraph
        commit
branch develop order: 2
commit
branch feature1 order: 3
commit
checkout develop
branch feature2 order: 4
commit
checkout develop
merge feature2
checkout feature1
commit
checkout develop
merge feature1
checkout main
merge develop
branch hotfix order: 1
commit
commit
checkout develop
commit
checkout develop
merge hotfix
checkout main
merge hotfix
Loading

branch role rule description
main μ£Όμš” 브랜치 μ‚­μ œ X production, μ„œλ²„μ— 배포될 브랜치
develop 개발 브랜치 μ‚­μ œ X frontend, backend, hotfix λΈŒλžœμΉ˜κ°€ ν•©μ³μ§ˆ 개발 브랜치
feature μ‹ κ·œ κΈ°λŠ₯ 개발 develop에 머지 ν›„ μ‚­μ œ issue에 ν•΄λ‹Ήν•˜λŠ” feature κ΅¬ν˜„ 브랜치
Β Β β—¦ feature/{μž‘μ—…μ΄λ¦„}-{이슈번호} ν˜•μ‹
Β Β β—¦ μž‘μ—…μ΄λ¦„μ€ kebab-case둜 ν•œλ‹€.
Β Β β—¦ e.g.) feature/social-123
hotfix 버그, μ—λŸ¬ μˆ˜μ • develop, main 머지 ν›„ μ‚­μ œ μ„œλ²„μ— λ°°ν¬λ˜μ—ˆκ±°λ‚˜, κΈ°λŠ₯ κ΅¬ν˜„μ΄ μ™„λ£Œλœ μƒν™©μ—μ„œ κΈ‰νžˆ 버그 ν”½μŠ€λ₯Ό ν•΄μ•Ό ν•  λ•Œ μƒμ„±ν•˜λŠ” 브랜치
Β Β β—¦ hotfix/{μž‘μ—…μ΄λ¦„}-{이슈번호} ν˜•μ‹
Β Β β—¦ μž‘μ—…μ΄λ¦„μ€ kebab-case둜 ν•œλ‹€.
Β Β β—¦ e.g.) hotfix/social-123

Git Merge μ „λž΅

  • feature β†’ develop : Squash & Merge
  • develop β†’ main : Create merge commit
πŸ’‘ μ°Έκ³ 
   developμ—μ„œ main으둜 갈 λ•Œμ—λŠ” ν”„λ‘ νŠΈμ™€ 백의 κΈ°λŠ₯이 λͺ¨λ‘ μ˜¨μ „νžˆ λŒμ•„κ°€κ²Œ λ˜μ—ˆμ„ λ•Œ λ¨Έμ§€μ‹œν‚€λ„λ‘ ν•˜μž.
Clone this wiki locally