-
Notifications
You must be signed in to change notification settings - Fork 0
๐ Turtle Run Project Github Flow Guide
TurtleRun ํ๋ก์ ํธ๋ ๊ธฐ๋ณธ์ ์ผ๋ก GitHub Flow๋ฅผ ๋ฐ๋ฅด๋ฉฐ, ์๋์ ๊ฐ์ ์ถ๊ฐ ๊ท์น์ ์ ์ฉํฉ๋๋ค.
GitHub Flow๋ ๋ค์๊ณผ ๊ฐ์ ๊ฐ๋จํ ์์น์ ๋ฐ๋ฅด๋ ๋ธ๋์น ๊ธฐ๋ฐ ๊ฐ๋ฐ ์ ๋ต์ ๋๋ค.
-
main๋ธ๋์น๋ ํญ์ ๋ฐฐํฌ ๊ฐ๋ฅํ ์ํ๋ก ์ ์งํฉ๋๋ค. - ์๋ก์ด ์์ ์ ํญ์ ๋ณ๋์ ๋ธ๋์น(feature branch)์์ ์์ํฉ๋๋ค.
- ์์ ์ด ์๋ฃ๋๋ฉด Pull Request(PR)๋ฅผ ์์ฑํ์ฌ ์ฝ๋ ๋ฆฌ๋ทฐ๋ฅผ ์งํํฉ๋๋ค.
- ๋ฆฌ๋ทฐ ๋ฐ ํ
์คํธ๊ฐ ๋๋๋ฉด
main๋ธ๋์น์ mergeํฉ๋๋ค. - ๋ฐฐํฌ๊ฐ ํ์ํ๋ฉด
main๋ธ๋์น์์ ๋ฐฐํฌํฉ๋๋ค.
- ๋ธ๋์น๋
main๊ณผ feature branch๋ก ๊ด๋ฆฌํฉ๋๋ค. - ๊ฐ ์์ ์ GitHub Project์์ ์์ฑ๋ issue(ํฐ์ผ) ๋จ์๋ก ์งํํฉ๋๋ค.
- ํฐ์ผ(issue) ํ๋๋น ์ผ๋ฐ์ ์ผ๋ก ํ๋์ ๋ธ๋์น/PR๋ก ์์ ํฉ๋๋ค.
- ๋ธ๋์น ์ด๋ฆ์ GitHub issue์์
Create branch๋ก ์์ฑํ์ ๋์ ์ด๋ฆ(์:123-fix-login-bug)์ ์ฌ์ฉํฉ๋๋ค.
- PR ์ ๋ชฉ์ ์์ ๋ด์ฉ์ ๊ฐ์ฅ ์ ๋ํ๋ด๋ commit convention์ ๋ง๋ ๋ฉ์์ง๋ก ์์ฑํฉ๋๋ค.
- PR์ squash merge๋ก ๊ด๋ฆฌํ์ฌ, main์๋ ํ๋์ ์ปค๋ฐ๋ง ๋จ๋๋ก ํฉ๋๋ค.
์ฌ๋ฌ ์์ ์ด ์์ฐจ์ ์ผ๋ก ์์กดํ๋ ๊ฒฝ์ฐ, main ๋ธ๋์น์ ์ปค๋ฐ ํ์คํ ๋ฆฌ๋ฅผ ์ต๋ํ linearํ๊ฒ ์ ์งํ๋ ๊ฒ์ ์์น์ผ๋ก ํฉ๋๋ค.
- ๋ค๋ฅธ ์์ ์ ์์กด์ฑ์ด ์๊ธฐ๋ฉด, ํด๋น ๋ธ๋์น๋ฅผ base๋ก ์๋ก์ด ๋ธ๋์น๋ฅผ ์์ฑํฉ๋๋ค.
- base branch๊ฐ main์ merge๋๋ฉด, ์์กด ๋ธ๋์น๋ rebase pull์ ๋ฐ์ main์ linearํ๊ฒ ์ ์งํฉ๋๋ค.
gitGraph
commit id: "main"
branch feat/some-screen
checkout feat/some-screen
commit id: "screen ์์
1"
commit id: "screen ์์
2"
commit id: "screen ์์
3"
branch feat/some-other-screen
checkout feat/some-other-screen
commit id: "๋ค๋ฅธ screen ์์
1"
commit id: "๋ค๋ฅธ screen ์์
2"
checkout feat/some-screen
checkout main
merge feat/some-screen
checkout feat/some-other-screen
commit id: "(feat/some-screen ๋ธ๋์น๊ฐ merge๋๋ฉด main์ผ๋ก rebase)"
gitGraph
commit id: "main"
commit id: "feat: add some screen"
branch feat/some-other-screen
checkout feat/some-other-screen
commit id: "๋ค๋ฅธ screen ์์
1"
commit id: "๋ค๋ฅธ screen ์์
2"
gitGraph
commit id: "main"
commit id: "feat: add some screen"
commit id: "feat: add some other screen"
# base ๋ธ๋์น์์ ์์
git checkout -b feat/some-screen
# ...์์
ํ PR & merge...
# ์์กด ๋ธ๋์น ์์ฑ (feat/some-screen์์ ์๋ก์ด ๋ธ๋์น ์์ฑ)
git checkout -b feat/some-other-screen
# ...์์
...
# feat/some-screen ๋ธ๋์น๊ฐ main์ Squash merge๋ ํ
git checkout feat/some-other-screen
git fetch origin
git rebase origin/main๊ฐ์ธ์ ํธ์์ ๋ฐ๋ผ sub branch ์ ๋ต์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
๋จ, ๊ด๋ฆฌ๊ฐ ๋ณต์กํ๊ณ ๋ณ๋ชฉ์ด ์๊ธธ ์ ์์ผ๋ฏ๋ก, ๊ฐ๊ธ์ main๊ณผ feature branch๋ง ์ฌ์ฉํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.
- ํฐ ์์ ์ sub branch๋ฅผ ๋๊ณ , ํด๋น sub branch์์ ์ฌ๋ฌ PR์ squash merge๋ก ๊ฐ๊ฐ ๋จ์ผ ์ปค๋ฐ์ผ๋ก ํฉ์นฉ๋๋ค.
- sub branch์๋ feature branch PR์ด squash merge๋ก ํฉ์ณ์ง ๋จ์ผ ์ปค๋ฐ๋ค๋ง ์กด์ฌํด์ผ ํฉ๋๋ค.
- sub branch๋ฅผ main์ mergeํ ๋๋ fast-forward merge๋ฅผ ์ฌ์ฉํ์ฌ, feature PR์ squash ์ปค๋ฐ๋ค์ด main์ ๊ทธ๋๋ก ๋จ๋๋ก ํฉ๋๋ค.
- ๋ง์ฝ sub branch์ squash commit ์ด์ธ์ ์ปค๋ฐ(์ฆ, sub branch์๋ง ์กด์ฌํ๋ ์ปค๋ฐ)์ด ํ๋๋ผ๋ ์๋ค๋ฉด, sub branch ์ ์ฒด๋ฅผ squash mergeํด์ main์ mergeํฉ๋๋ค. (์ด ๊ฒฝ์ฐ, sub branch์ ์ปค๋ฐ ํ์คํ ๋ฆฌ๋ main์ ๋จ์ง ์์ต๋๋ค)
gitGraph
commit id: "main"
branch feature/big-module
checkout feature/big-module
branch feature/module-1
checkout feature/module-1
commit id: "feat: add module 1"
commit id: "refactor: refactor something"
gitGraph
commit id: "main"
branch feature/big-module
checkout feature/big-module
commit id: "feat: add module 1"
gitGraph
commit id: "main"
branch feature/big-module
checkout feature/big-module
commit id: "feat: add module 1"
branch feature/module-2
checkout feature/module-2
commit id: "feat: add module 2"
commit id: "fix: fix some bug"
commit id: "chore: remove comments"
checkout feature/big-module
merge feature/module-2
gitGraph
commit id: "main"
commit id: "feat: add module 1"
commit id: "feat: add module 2"
โ ๏ธ sub branch์ squash commit ์ด์ธ์ ์ง์ ์ปค๋ฐ์ด ์๋ ๊ฒฝ์ฐ์๋ง fast-forward merge๋ฅผ ํ์ฉํฉ๋๋ค. ์ด๋ main์๋ feature PR์ squash ์ปค๋ฐ๋ค์ด ๊ทธ๋๋ก ๋ณด์กด๋ฉ๋๋ค.
- main๊ณผ feature branch ์ค์ฌ์ ๋จ์ํ ๋ธ๋์น ์ ๋ต์ ๊ถ์ฅํฉ๋๋ค.
- ์ฌ๋ฌ ์์ ์ด ์์กดํ๋ ๊ฒฝ์ฐ, ๋ธ๋์น ์์กด์ฑ ๊ด๋ฆฌ(Linear Workflow)๋ฅผ ์ ๊ทน์ ์ผ๋ก ํ์ฉํฉ๋๋ค.
- ๋๊ท๋ชจ ์์ ์ด ํ์ํ ๊ฒฝ์ฐ์๋ง sub branch ์ ๋ต์ ์ฌ์ฉํ๋ฉฐ, ๊ด๋ฆฌ ๊ท์น์ ๋ฐ๋์ ์ค์ํฉ๋๋ค.
- ๋ชจ๋ PR์ squash merge๋ฅผ ๊ธฐ๋ณธ์ผ๋ก ํ๋, sub branch์ ๊ฒฝ์ฐ ์ํฉ์ ๋ฐ๋ผ forward merge๋ฅผ ์ฌ์ฉํฉ๋๋ค.
- ๋ธ๋์น ์์กด์ฑ์ rebase๋ก main์ linearํ๊ฒ ์ ์งํฉ๋๋ค.