Skip to content

๐Ÿ”ฅ Branch ์ „๋žต ๐Ÿ”ฅ

์ข…๋ฏธ(๋ฏธ์•„) edited this page Jul 24, 2024 · 1 revision

Git Flow ๋ธŒ๋žœ์น˜ ์ „๋žต ์ฐธ๊ณ 

  • main : ์ œํ’ˆ์œผ๋กœ ์ถœ์‹œ๋  ์ˆ˜ ์žˆ๋Š” ๋ฐฐํฌ ๋ธŒ๋žœ์น˜
  • be/* : backend ์ „์šฉ ์ž‘์—… branch
  • an/* : android ์ „์šฉ ์ž‘์—… branch
  • an/develop, be/develop: ๋‹ค์Œ ์ถœ์‹œ ๋ฒ„์ „์„ ๊ฐœ๋ฐœํ•˜๋Š” ๋ธŒ๋žœ์น˜
  • an/feat/*, be/feat/* : ๊ธฐ๋Šฅ ๊ฐœ๋ฐœํ•˜๋Š” ๋ธŒ๋žœ์น˜ (e. an/feat/pokedex)
  • an/release : ์ด๋ฒˆ ์ถœ์‹œ ๋ฒ„์ „์„ ์ค€๋น„ํ•˜๋Š” ๋ธŒ๋žœ์น˜ (QA, BugFix)
  • an/hotfix: ์ถœ์‹œ ๋ฒ„์ „์—์„œ ๋ฐœ์ƒํ•œ ๋ฒ„๊ทธ๋ฅผ ์ˆ˜์ • ํ•˜๋Š” ๋ธŒ๋žœ์น˜
  • */develop, */feat/์ž‘์—…๋ช…, hotfix, release (๋ธŒ๋žœ์น˜ ์‚ญ์ œ, ์ƒ์„ฑ ๋งค๋ฒˆ ํ•ด์ค˜์•ผํ•จ)
  • hotfix, release, main ์€ Android, Backend ๊ฐ€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๋Š” ๊ณต์šฉ ๋ธŒ๋žœ์น˜์ด๋‹ค.

๐Ÿ’ฅ AN ๊นƒ ๋ธŒ๋žœ์น˜ ์ปจ๋ฒค์…˜

1. ์ž‘์—… ๋ธŒ๋žœ์น˜ ๋„ค์ด๋ฐ ์ปจ๋ฒค์…˜

branch ๋Š” ํ•ญ์ƒ an ์„ root๋กœ ์‚ผ๋Š”๋‹ค.

an{ํƒœ๊ทธ}/ํ™”๋ฉด_์ž‘์—…๋ช…

ex) an/feat/type_ui

2. ๊นƒํ—ˆ๋ธŒ ๋ธŒ๋žœ์น˜ ์ „๋žต

๐Ÿ”ฅ main , an/develop, an/feat, an/refactor, an/release, an/hotfix ์ด ์กด์žฌํ•œ๋‹ค.

an/develop ์—์„œ ์ž‘์—… ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.

3. ๋ธŒ๋žœ์น˜ ์ž‘์—… ๋ฐฉ์‹

branch ๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์ž‘์—…ํ•˜๋Š” ๊ฒฝ์šฐ ์ด์™€ ๊ฐ™์€ ๊ณผ์ •์„ ๋”ฐ๋ฅธ๋‹ค.

  1. branch ๋ฅผ ์ƒ์„ฑํ•˜๊ธฐ ์ „ git pull ์„ ํ†ตํ•ด develop์„ ์—…๋ฐ์ดํŠธ ํ•œ๋‹ค.
  2. ๋ธŒ๋žœ์น˜๋ฅผ ๋„ค์ด๋ฐ์— ๋งž๊ฒŒ ์ƒ์„ฑํ•œ๋‹ค.
  3. git fetch ๋ฅผ ํ†ตํ•˜์—ฌ ๋ฐœ์ƒํ•˜๋Š” conflict ๋ฅผ ํ™•์ธํ•œ๋‹ค.
  4. git pull --rebase [์›๊ฒฉ ์ €์žฅ์†Œ] [๋ธŒ๋žœ์น˜] ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ๋ฆฌ๋ฒ ์ด์Šค ํ•˜์—ฌ ํ•ด๊ฒฐํ•œ๋‹ค.
  5. ๋ณ€๊ฒฝ์‚ฌํ•ญ๋“ค์„ commit ํ›„์— push ํ•œ๋‹ค.
  6. squash merge ํ›„ ๋จธ์ง€๋œ ๋ธŒ๋žœ์น˜๋ฅผ delete ํ•œ๋‹ค.

๐Ÿ’ฅ BE ๊นƒ ๋ธŒ๋žœ์น˜ ์ปจ๋ฒค์…˜

1. ์ž‘์—… ๋ธŒ๋žœ์น˜ ๋„ค์ด๋ฐ ์ปจ๋ฒค์…˜

๋ฐ˜๋“œ์‹œ be/** ๋ฐฉ์‹์œผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.

be/{ํƒœ๊ทธ}/#{์ด์Šˆ๋ฒˆํ˜ธ}-{CRUD}-{๋„๋ฉ”์ธ์ด๋ฆ„}-api

ex) be/feat/#123-post-pokemon-api , be/fix/#124-post-pokemon-api

2. ๊นƒํ—ˆ๋ธŒ ๋ธŒ๋žœ์น˜ ์ „๋žต

๐Ÿ”ฅ main , be-develop, be-feat/ ์ด ์กด์žฌํ•œ๋‹ค.

be-develop ์—์„œ ์ž‘์—… ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.

3. ๋ธŒ๋žœ์น˜ ์ž‘์—… ๋ฐฉ์‹

branch ๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์ž‘์—…ํ•˜๋Š” ๊ฒฝ์šฐ ์ด์™€ ๊ฐ™์€ ๊ณผ์ •์„ ๋”ฐ๋ฅธ๋‹ค.

  1. branch ๋ฅผ ์ƒ์„ฑํ•˜๊ธฐ ์ „ git pull ์„ ํ†ตํ•ด develop์„ ์—…๋ฐ์ดํŠธ ํ•œ๋‹ค.
  2. ๋ธŒ๋žœ์น˜๋ฅผ ๋„ค์ด๋ฐ์— ๋งž๊ฒŒ ์ƒ์„ฑํ•œ๋‹ค.
  3. git fetch ๋ฅผ ํ†ตํ•˜์—ฌ ๋ฐœ์ƒํ•˜๋Š” conflict ๋ฅผ ํ™•์ธํ•œ๋‹ค.
  4. git pull --rebase [์›๊ฒฉ ์ €์žฅ์†Œ] [๋ธŒ๋žœ์น˜] ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ๋ฆฌ๋ฒ ์ด์Šค ํ•˜์—ฌ ํ•ด๊ฒฐํ•œ๋‹ค.
  5. ๋ณ€๊ฒฝ์‚ฌํ•ญ๋“ค์„ commit ํ›„์— push ํ•œ๋‹ค.
  6. merge ํ›„ ๋จธ์ง€๋œ ๋ธŒ๋žœ์น˜๋ฅผ delete ํ•œ๋‹ค.

๐ŸŽซ ๋ฏธ์…˜

  1. hotfix ๋ธŒ๋žœ์น˜๋ฅผ main์—์„œ ๋”ด๋‹ค.
  2. feat ๋ธŒ๋žœ์น˜์— ์—ญํ• ์„ ์ปค๋ฐ‹/ํ‘ธ์‰ฌํ•œ๋‹ค.
  3. hotfix๋ธŒ๋žœ์น˜์—์„œ ํ”„๋กœ์ ํŠธ์†Œ๊ฐœ ๋ธŒ๋žœ์น˜๋ฅผ ๋”ฐ๊ณ , main๊ณผ dev๋ธŒ๋žœ์น˜์— ๋จธ์ง€๋ฅผ ์‹œํ‚จ๋‹ค.
  4. feat๋ธŒ๋žœ์น˜์—์„œ ๋‹ด๋‹น์ฝ”์น˜๋ฅผ ์ž‘์„ฑํ•˜๊ณ  dev โ†’ relaese โ†’ main ์ˆœ์œผ๋กœ ๋จธ์ง€ํ•œ๋‹ค.
  5. ์—ญํ• ์„ dev โ†’ release(qa๊ฐ€ ์žˆ๋‹ค๋ฉด qa๋ฅผ ์ง„ํ–‰ํ•œ๋‹ค) โ†’ main์ˆœ์œผ๋กœ ๋จธ์ง€ํ•œ๋‹ค.
Clone this wiki locally