Skip to content

github flow

devJang edited this page Jun 22, 2018 · 8 revisions

Github Flow


์ดˆ๊ธฐํ™” ๋ฐฉ๋ฒ•

๊ฐœ์ธ ์ •๋ณด (์ถฉ๋ถ„ํžˆ ์ดํ•ดํ•˜๊ณ  ์ธ์ง€ํ•œ ๊ฒฝ์šฐ ์ž์œ ๋กญ๊ฒŒ ์„ค์ •)

username: ๋ณธ์ธ์˜ ๊นƒํ—™ ์ ‘์† ํ›„ URL์˜ github.com/username <== ๋’ท ๋ถ€๋ถ„ ์ฟผ๋ฆฌ ํ™•์ธ

email: https://github.com/settings/profile์— ์„ค์ •๋œ Public email

์ €์žฅ์†Œ ์ •๋ณด (์˜คํƒ€ ์—†์–ด์•ผํ•ฉ๋‹ˆ๋‹ค)

upstream ์ €์žฅ์†Œ: https://github.com/remote-develop-study/fp-study-ground

origin ์ €์žฅ์†Œ: https://github.com/์ž์‹ ์˜username/fp-study-ground

1. ์˜ค๊ฑฐ๋‚˜์ด์ €์˜ ์ €์žฅ์†Œ๋ฅผ ์ž์‹ ์˜ ๊ณ„์ •์œผ๋กœ ์ €์žฅ์†Œ๋กœ Fork

upstream ์ €์žฅ์†Œ URL: https://github.com/remote-develop-study/fp-study-ground

=> ์ž์‹ ์˜ ๊ณ„์ •์— ์ €์žฅ์†Œ ๋ณต์‚ฌ๋จ origin ์ €์žฅ์†Œ https://github.com/์ž์‹ ์˜username/fp-study-ground

2. ์ž์‹ ์˜ ๊ณ„์ • ์ €์žฅ์†Œ๋ฅผ ์ž‘์—… PC ๋˜๋Š” ๋žฉํƒ‘ ๋กœ์ปฌ๋กœ git clone

$ git clone https://github.com/์ž์‹ ์˜username/fp-study-ground

3. ์ €์žฅ์†Œ ๊ณ„์ • ์ •๋ณด ์ดˆ๊ธฐํ™” (์ฐธ๊ณ )

$ git config user.name "์ž์‹ ์˜username" ์ž…๋ ฅ
$ git config user.email Public-email ์ž…๋ ฅ

=> ์ œ๋Œ€๋กœ๋œ ์ •๋ณด ์ž…๋ ฅ๋˜์—ˆ๋Š”์ง€ ํ™•์ธ

$ git config user.name
$ git config user.email

4. upstream ์ €์žฅ์†Œ ๋“ฑ๋ก

$ git remote add upstream https://github.com/remote-develop-study/fp-study-ground

=> ์ œ๋Œ€๋กœ๋œ ์ •๋ณด ์ž…๋ ฅ๋˜์—ˆ๋Š”์ง€ ํ™•์ธ

$ git remote -v

=> ์ •์ƒ ๊ฒฐ๊ณผ

origin  https://github.com/์ž์‹ ์˜username/fp-study-ground.git (fetch)
origin  https://github.com/์ž์‹ ์˜username/fp-study-ground.git (push)
upstream        https://github.com/remote-develop-study/fp-study-ground (fetch)
upstream        https://github.com/remote-develop-study/fp-study-ground (push)

5. ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ

// ๋ธŒ๋žœ์น˜ ๋ณ€๊ฒฝ๊ณผ ์ƒ์„ฑ์„ ๋™์‹œ์—ํ•จ (local)
$ git checkout -b ์ž์‹ ์˜username 
// ์ƒ์„ฑ๋œ ๋ธŒ๋žœ์น˜๋ฅผ ์ž์‹ ์˜ ์ €์žฅ์†Œ์— ๋ฐ˜์˜ (origin)
$ git push --set-upstream origin ์ž์‹ ์˜username
// ์ƒ์„ฑ๋œ ๋ธŒ๋žœ์น˜๋ฅผ ์˜ค๊ฑฐ๋‚˜์ด์ € ์ €์žฅ์†Œ์— ๋ฐ˜์˜ (upstream)
$ git push --set-upstream upstream ์ž์‹ ์˜username

Pull

$ git pull upstream master

Push

origin ๋ธŒ๋žœ์น˜์— ํ‘ธ์‹œํ•˜๋Š” ๊ณผ์ •์€ TS ์Šคํ„ฐ๋””์™€ ๋™์ผํ•ฉ๋‹ˆ๋‹ค

// git add & git commit ์™„๋ฃŒ ํ›„
$ git push origin ์ž์‹ ์˜๋‹‰๋„ค์ž„

Merge Request

  1. ๋ธŒ๋ผ์šฐ์ €๋ฅผ ํ†ตํ•ด ์ €์žฅ์†Œ ์ ‘์† (origin ๋˜๋Š” upstream ์ƒ๊ด€์—†์Œ)

  2. Compare & pull request ํด๋ฆญ

  3. base ์ž์‹ ์˜ ๋ธŒ๋žœ์น˜ <= compare ์ž์‹ ์˜ ๋ธŒ๋žœ์น˜ ์„ ํƒ

์ ˆ๋Œ€ master ๋ธŒ๋žœ์น˜๋Š” ๊ฑด๋“œ๋ฆฌ์ง€ ์•Š์Šต๋‹ˆ๋‹ค (๋ณธ์ธ์ด ์ถœ์ œํ•  ๊ฒฝ์šฐ์—๋งŒ ๊ฐ€๋Šฅ)

  1. ํ•„ํžˆ diff(๋ณ€๊ฒฝ์‚ฌํ•ญ) ํ™•์ธ ์ž˜๋ชป๋œ ์ฝ”๋“œ ์ž…๋ ฅ์ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•จ

  2. pull request ์ œ๋ชฉ๊ณผ ๋‚ด์šฉ ์ž‘์„ฑ
    ํ•„์š”์— ๋”ฐ๋ผ Reviewers์™€ Assigners๋ฅผ ์„ค์ •ํ•ด์„œ ์ฝ”๋“œ๋ฆฌ๋ทฐ๊ฐ€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค(๊ธฐ๋ณธ์ ์œผ๋กœ๋Š” ์…€ํ”„ ์ˆ˜๋ฝ ๊ฐ€๋Šฅ)
    Labels์€ ์ƒํ™ฉ์— ๋งž๊ฒŒ ๋„ฃ์–ด์ฃผ์„ธ์š”

ํ•„์ˆ˜์‚ฌํ•ญ: ์ œ๋ชฉ, ๋‚ด์šฉ, Labels

=> Create pull request ํด๋ฆญ


๋„์›€๋˜๋Š” ์ฐธ๊ณ  ์ž๋ฃŒ

https://milooy.wordpress.com/2017/06/21/working-together-with-github-tutorial

https://wayhome25.github.io/git/2017/07/08/git-first-pull-request-story

https://steemit.com/github/@nadongguri/github-repository-push-pull-request

Clone this wiki locally