From 449b5b078e038c4ae51c5378278d0ace58a8a190 Mon Sep 17 00:00:00 2001 From: Stilllee Date: Thu, 3 Apr 2025 22:50:14 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[docs]=20Git=20=EB=B8=8C=EB=9E=9C=EC=B9=98?= =?UTF-8?q?=20=EC=A0=84=EB=9E=B5=20=EA=B0=80=EC=9D=B4=EB=93=9C=20=EB=AC=B8?= =?UTF-8?q?=EC=84=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/git-strategy.md | 111 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 docs/git-strategy.md diff --git a/docs/git-strategy.md b/docs/git-strategy.md new file mode 100644 index 0000000..e2e5670 --- /dev/null +++ b/docs/git-strategy.md @@ -0,0 +1,111 @@ +# Git 브랜치 전략 가이드 + +## 1. 브랜치 구조 + +- `main`: 배포용 브랜치 + - 안정적인 배포 버전 관리 + - 직접적인 커밋 지양 (핫픽스 제외) +- `develop`: 개발 통합 브랜치 + - 모든 개발 내용이 모이는 곳 + - 각 목적별 브랜치들의 베이스 + +### 목적별 브랜치 + +- `feature/*`: 새로운 기능 개발 + + - 예: `feature/login`, `feature/signup` + +- `config`: 설정 관련 변경 + + - 프로젝트 설정, 환경 설정 등 + +- `refactor/*`: 코드 리팩토링 + + - 예: `refactor/auth-logic`, `refactor/api-structure` + - 기능 변경 없는 코드 개선 + +- `bug/*`: 버그 수정 + - 예: `bug/login-error`, `bug/data-fetch` + - 기존 기능의 오류 수정 + +## 2. 작업 흐름 + +### 2.1 브랜치 생성 및 작업 + +1. develop에서 목적에 맞는 브랜치 생성 + +```bash +git switch develop +git pull origin develop + +# 목적에 따른 브랜치 생성 +git checkout -b feature/new-feature +``` + +2. 작업 및 커밋 + +```bash +git add . +git commit -m "[feat] 새로운 기능 구현" +``` + +### 2.2 브랜치 동기화 + +```bash +# 1. 로컬 develop 브랜치 최신화 +git switch develop +git pull origin develop + +# 2. 작업 브랜치 동기화 +git switch [브랜치명] # ex: feature/login +git rebase develop # 로컬 develop 기준으로 재배치 +git push origin [브랜치명] --force # 필요시 +``` + +## 3. 커밋 메시지 규칙 + +``` +[type] 제목 + +- 본문 (선택사항) +``` + +- type 종류 (브랜치 유형과 일치): + - `feat`: 새로운 기능 + - `chore`: 설정 및 기다 변경사항 + - `refactor`: 리팩토링 + - `fix`: 버그 수정 + - `docs`: 문서 수정 + - `test`: 테스트 코드 + - `move`: 파일 이동 + - `typo`: 오탈자 수정 + - `style`: 스타일 코드 수정 + +## 4. PR 및 머지 전략 + +1. 모든 유형의 브랜치는 develop으로 PR + +2. develop -> main은 스쿼시 머지 + - 배포 히스토리 깔끔하게 관리 + - develop 브랜치의 상세 히스토리는 보존 + +## 5. GitHub Actions 자동화 + +- PR 체크: 테스트 및 빌드 자동화 +- develop -> main 자동 스쿼시 머지 + +## 7. 핫픽스 처리 + +1. main에서 직접 수정이 발생한 경우: + +```bash +git switch develop +git merge main # main의 변경사항을 develop으로 동기화 +``` + +2. 이후 작업 브랜치 동기화: + +```bash +git switch [브랜치명] +git rebase develop # 최신 develop(핫픽스 포함) 기준으로 재배치 +``` From d67ea8fec90892c27aff63439c6c24dd9ddf04c0 Mon Sep 17 00:00:00 2001 From: Stilllee Date: Thu, 3 Apr 2025 23:19:06 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[docs]=20=EB=B2=84=EA=B7=B8=20=EC=9D=B4?= =?UTF-8?q?=EC=8A=88=20=ED=85=9C=ED=94=8C=EB=A6=BF=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?#3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.md diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..ff2da78 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,13 @@ +--- +name: 버그 이슈 +about: 버그 관련 이슈를 생성할 때 사용하는 템플릿입니다. 설명과 작업 항목을 작성해주세요. +title: "" +labels: "🐞 BUG" +assignees: "Stilllee" +--- + +## 문제상황 + +
+ +## 해결 방법 From 807f66594f47ec9ac78c04e76ccb00cd330cc7ae Mon Sep 17 00:00:00 2001 From: Stilllee Date: Thu, 3 Apr 2025 23:31:02 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[chore]=20PR=20=EC=9E=90=EB=8F=99=20?= =?UTF-8?q?=EB=A8=B8=EC=A7=80=20=EC=98=B5=EC=85=98=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?(--auto=20--admin)=20#4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PR이 모든 조건(빌드, 리뷰)을 충족할 때까지 대기 후 자동 머지 - branch protection rules 우회를 위한 관리자 권한 사용 --- .github/workflows/pr-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 47733f1..4e623a1 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -36,6 +36,6 @@ jobs: - name: Merge PR if build success if: success() run: | - gh pr merge ${{ github.event.pull_request.number }} --merge + gh pr merge ${{ github.event.pull_request.number }} --merge --auto --admin env: GITHUB_TOKEN: ${{ secrets.WORKFLOW_PAT }} From 1176be7d463f815d6c28f9ea037b0bae5ca4d506 Mon Sep 17 00:00:00 2001 From: Stilllee Date: Thu, 3 Apr 2025 23:34:02 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[chore]=20PR=20=EC=9E=90=EB=8F=99=20?= =?UTF-8?q?=EB=A8=B8=EC=A7=80=20=EC=98=B5=EC=85=98=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?#4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 자동 머지 옵션에서 --auto 제거 --- .github/workflows/pr-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 4e623a1..7da5b4c 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -36,6 +36,6 @@ jobs: - name: Merge PR if build success if: success() run: | - gh pr merge ${{ github.event.pull_request.number }} --merge --auto --admin + gh pr merge ${{ github.event.pull_request.number }} --merge --admin env: GITHUB_TOKEN: ${{ secrets.WORKFLOW_PAT }} From 85f0c461d421c50e3d692d6d725fbb083b9cf610 Mon Sep 17 00:00:00 2001 From: Stilllee Date: Thu, 3 Apr 2025 23:53:18 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[chore]=20develop-to-main=20=EB=A8=B8?= =?UTF-8?q?=EC=A7=80=20=EC=8B=9C=20=EA=B4=80=EB=A6=AC=EC=9E=90=20=EA=B6=8C?= =?UTF-8?q?=ED=95=9C=20=EC=82=AC=EC=9A=A9=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - main 브랜치로의 푸시 시 --admin 옵션을 사용하도록 수정 --- .github/workflows/develop-to-main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/develop-to-main.yml b/.github/workflows/develop-to-main.yml index 4d0e6e2..d9a4688 100644 --- a/.github/workflows/develop-to-main.yml +++ b/.github/workflows/develop-to-main.yml @@ -27,6 +27,6 @@ jobs: git checkout main git merge --squash develop git commit -m "$PR_TITLE" - git push origin main + git push origin main --admin env: GITHUB_TOKEN: ${{ secrets.WORKFLOW_PAT }}