Skip to content

๐Ÿ€ Git Flow

Yunseo Kang edited this page Jan 2, 2023 · 1 revision

๐ŸŒฟ Git Flow ์ „๋žต

๋ฉ”์ธ ๋ ˆํฌ์—์„œ ๋ธŒ๋žœ์น˜๋ฅผ ํ˜•์„ฑํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹Œ, ๊ฐ์ž ๋ ˆํฌ๋ฅผ forkํ•œ ํ›„ ๋ณธ์ธ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์—์„œ ์ž‘์—… ์ดํ›„ ๋ฉ”์ธ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— PR์„ ์š”์ฒญํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

  1. ํŒ€ ํ”„๋กœ์ ํŠธ repo๋ฅผ ํฌํฌํ•œ๋‹ค.(์ดํ•˜ ํŒ€ ๋ ˆํฌ, DO-NOTTO-DO/NotToDo-iOS)

  2. ํฌํฌํ•œ ๊ฐœ์ธ repo(์ดํ•˜ ๊ฐœ์ธ repo)๋ฅผ cloneํ•œ๋‹ค.

  3. ๊ฐœ์ธ repo์—์„œ ์ž‘์—…ํ•˜๊ณ  ๊ฐœ์ธ repo์˜ ์›๊ฒฉ์ €์žฅ์†Œ๋กœ pushํ•œ๋‹ค.

    ๊ฐœ์ธ ๋ ˆํฌ๊ฐ€ origin์œผ๋กœ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ์„ ๊ฒฝ์šฐ git push origin [์ž‘์—…๋ธŒ๋žœ์น˜๋ช…]

  4. pull request๋ฅผ ํ†ตํ•ด์„œ ํŒ€ repo๋กœ mergeํ•œ๋‹ค.

  5. pull ๋ฐ›์•„์•ผ ํ•  ๋•Œ์—๋Š” ํŒ€ repo์—์„œ pull ๋ฐ›๋Š”๋‹ค.

    git pull upstream devlop



๐ŸŒฑ ์ž‘์—…์˜ ์ „์ฒด์ ์ธ ๊ณผ์ •

  1. ๊นƒํ—™์—์„œ ์ด์Šˆ ํŒŒ๊ธฐ
    1. UI ๊ตฌํ˜„ ๋‹จ์œ„, ๊ธฐ๋Šฅ ํ•˜๋‚˜ ์ถ”๊ฐ€ ๋‹จ์œ„๋กœ ๊ฐ€์ ธ๊ฐ„๋‹ค. ex) [Feat] ํ™ˆ ๋ทฐ ๊ตฌํ˜„ํ•˜๊ธฐ
  2. local์— ์žˆ๋Š” develop ์ตœ์‹ ํ™”ํ•˜๊ธฐ
    1. git pull upstream develop
  3. local์— ์žˆ๋Š” develop ๊ธฐ์ค€์œผ๋กœ ์ž‘์—…ํ•  ๋ธŒ๋žœ์น˜ ํŒŒ๊ธฐ
    1. ์œ„์—์„œ ํŒ ์ด์Šˆ๊ฐ€ 1๋ฒˆ์ด์—ˆ๋‹ค๋ฉด, feature/#1
  4. ์ž‘์—… ๋ฐ ์ปค๋ฐ‹ํ•˜๊ธฐ
    1. ์ปค๋ฐ‹์€ ์ž˜๊ฒŒ ์ชผ๊ฒŒ์„œ ํ•˜๋Š” ์—ฐ์Šตํ•˜๊ธฐ!
    2. ์ปค๋ฐ‹ ๋‚ด์šฉ๋ณ„๋กœ prefix ์ž˜ ๋ถ™์—ฌ์ฃผ๊ธฐ!
    3. ์ž‘์—… ๋๋‚˜๋ฉด PR์„ ์˜ฌ๋ฆฌ์ง€ ์•Š๋”๋ผ๋„ ํ•ญ์ƒ push๊นŒ์ง€ ํ•ด์ฃผ๊ธฐ
    4. push๋ฅผ ํ•ด์•ผ ๋‹ค๋ฅธ ํŒ€์›์˜ forked repository์— ์ ‘๊ทผํ•ด์„œ ๋‚ด์šฉ์„ ํ™•์ธ ๊ฐ€๋Šฅํ•˜๊ธฐ ๋•Œ๋ฌธ!
  5. PR ๋งŒ๋“ค๊ธฐ
  6. ๋‹ค๋ฅธ ํŒ€์› ์ฝ”๋“œ๋ฆฌ๋ทฐ ๋ฐ›๊ณ , ๋ฐ˜์˜ํ•  ๋‚ด์šฉ ๋ฐ˜์˜ํ•˜๊ธฐ
  7. Mergeํ•˜๊ธฐ
    1. Merge ์ „์— git pull upstream develop ํ•ด์„œ ๋‚ด์šฉ ํ•ญ์ƒ ์ตœ์‹ ํ™”ํ•˜๊ธฐ
    2. pull ๋ฐ›์€ ๋‚ด์šฉ์ด ํ”„๋กœ์ ํŠธ์—์„œ ์ž˜ ์‹คํ–‰๋˜๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ
    3. ์ตœ์ข…์ ์œผ๋กœ Merge ์ „์— ๋‹ค๋ฅธ ํŒ€์›๋“ค์—๊ฒŒ Mergeํ•ด๋„ ๋˜๋Š”์ง€ ๋ฌผ์–ด๋ณด๊ธฐ
    4. approve ๋ฐ›๊ณ  mergeํ•˜๊ธฐ
    5. ๋” ์ด์ƒ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” branch๋ผ๋ฉด delete branch ํ•ด์ฃผ๊ธฐ