728x90
๋ฐ˜์‘ํ˜•

 

๐Ÿฃ Github๋กœ ํ˜‘์—…ํ•˜๊ธฐ (VScode) - '๋‚ด ์ž์‹ '์ด ํŒ€์žฅ์ผ ๋•Œ

 

 

1. Repository ์ƒ์„ฑ ( ์šฐ์ธก ์ƒ๋‹จ ํ”„๋กœํ•„ ์•„์ด์ฝ˜ ํด๋ฆญ → Your repositories )

 

 

 

 

2. New Repositories ํด๋ฆญ

 

 

 

 

3. Repository name ์ž…๋ ฅ add a README file(์„ ํƒ์‚ฌํ•ญ) Create repository ํด๋ฆญ

 

 

 


๐Ÿ˜‡ํ˜‘์—…์ž ์ดˆ๋Œ€ํ•˜๊ธฐ (๊ฑด๋„ˆ๋›ฐ์–ด๋„๋Œ! ํ•„์š”ํ•˜์‹  ๋ถ„๋งŒ๐Ÿ˜Š)

 

1. ์ขŒ์ธก ์ƒ๋‹จ์— ํ˜‘์—…ํ•  Repository name ํ™•์ธํ•˜๊ณ  Settings → Collaborators    Add people ํด๋ฆญ

 

 

 

 

2. Github ๊ณ„์ • ์ž…๋ ฅํ•˜์—ฌ ํ˜‘์—…์ž ์ฐพ์•„์„œ ์„ ํƒ ํ›„ Select a collaborator above ํด๋ฆญ

 

 

 

 

3. ์ถ”๊ฐ€๋œ ๋ชจ์Šต์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ํ˜‘์—…์ž๊ฐ€ ์—ฌ๋Ÿฌ๋ช…์ผ ๋•Œ Add people ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ด ๋™์ผํ•˜๊ฒŒ ์ง„ํ–‰


 

 

 

 

4. VScode์— ์ž‘์—…์ค‘์ธ ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ์žˆ์—ˆ๋‹ค๋ฉด, Ctrl+Shift+N์„ ๋ˆŒ๋Ÿฌ ์ƒˆ ์ฐฝ์œผ๋กœ ์—ด์–ด์ค€๋‹ค.

 

 

 

 

5. ์ขŒ์ธก ์•„์ด์ฝ˜์— [์†Œ์Šค์ œ์–ด] ์„ ํƒ 

 

 

 

 

6. Github๋กœ ์™€์„œ ์ƒ๋‹จ ๋ฉ”๋‰ด์— [ < > ์ฝ”๋“œ ] → ์ดˆ๋ก์ƒ‰๋ฒ„ํŠผ < > Code ํด๋ฆญ →  HTTPS ์ฃผ์†Œ ๋ณต์‚ฌ

 

 

 


๐Ÿค”main ๋ธŒ๋žœ์น˜(branch) ๋ณดํ˜ธํ•˜๊ธฐ ! (๊ฑด๋„ˆ๋›ฐ์–ด๋„๋Œ! ํ•„์š”ํ•˜์‹  ๋ถ„๋งŒ๐Ÿ˜Š)

 

 

1. Setting → Branches → Add branch protection rule ํด๋ฆญ

 

 

 

 

 

2. Branch name pattern ์ž‘์„ฑ ํ›„ Require a pull request before merging ์ฒดํฌ → Lock branch ์ฒดํฌ → Create ํด๋ฆญ

 

[main] branch๋Š” ๊ฐ€์žฅ ์ค‘์š”ํ•˜๊ณ  ํ•จ๋ถ€๋กœ ๋ฐ”๊ฟ”์„œ๋Š” ์•ˆ๋˜๋Š” branch์ด๊ณ , ํ”„๋กœ์ ํŠธ ์™„์„ฑ ํ›„ ์ตœ์ข…๋ณธ์„ ์—…๋กœ๋“œํ•˜๋Š” branch์ด๋‹ค.

๋”ฐ๋ผ์„œ, ํ˜‘์—…์ž๋“ค ๊ฐœ๊ฐœ์ธ์ด ํ•จ๋ถ€๋กœ [main] branch์— pushํ•  ์ˆ˜ ์—†๋„๋ก ๋ณดํ˜ธ(Lock) ํ•ด์ฃผ๋Š” ๊ธฐ๋Šฅ์ด๋‹ค. 

* default branch ์ด๋ฆ„์€ ๋ฐ”๋€” ์ˆ˜ ์žˆ์Œ! ์—ฌ๊ธฐ์„œ๋Š” main์„ default branch ์”๋‹ˆ๋‹ค.

 

 

 

3. ๋ณดํ˜ธ ์™„๋ฃŒ

 

 


 

 

 

 

 

7. [๋ฆฌํŒŒ์ง€ํ† ๋ฆฌ ๋ณต์ œ] ๋˜๋Š” ๊ฐ€์šด๋ฐ [Git ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋ณต์ œ...] ํด๋ฆญ → ์ƒ๋‹จ ์ฐฝ์— ๋ณต์‚ฌํ•ด์˜จ HTTPS ๋ถ™์—ฌ๋„ฃ๊ธฐ

 

 

 

 

8. ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ๋ฐ”ํƒ•ํ™”๋ฉด์œผ๋กœ ์ง€์ • ํ›„ → ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋Œ€์ƒ์œผ๋กœ ์„ ํƒ   ์—ด๊ธฐ

 

 

 

 

 

๐Ÿ˜ณ Branch ์ƒ์„ฑํ•˜๊ธฐ

์—ฌ๊ธฐ์„œ๋Š” master, sub1, sub2, sub3 ์ด 4๊ฐœ์˜ branch๋ฅผ ์ƒ์„ฑํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

 

 

9. ์ขŒ์ธก ํ•˜๋‹จ์— main ๋ธŒ๋žœ์น˜๋Š” ์‚ฌ์šฉํ•˜๋ฉด ์•ˆ๋˜๋ฏ€๋กœ [์ƒˆ ๋ถ„๊ธฐ ๋งŒ๋“ค๊ธฐ...] ํด๋ฆญ 

 

 

 

 

 

10. Branch ์ด๋ฆ„ ์ ๊ธฐ

 

 

 

 

11. ์ขŒ์ธก ํ•˜๋‹จ์— โ˜๏ธ ๊ตฌ๋ฆ„๋ชจ์–‘ ํด๋ฆญํ•˜์—ฌ [์ƒ์„ฑ ํ›„ ๋ถ„๊ธฐ ๊ฒŒ์‹œ] ๋ˆŒ๋Ÿฌ์ฃผ๊ธฐ (github์— Branch ์—…๋ฐ์ดํŠธ)

 

 

[๋‹ค์Œ์—์„œ ์ƒˆ ๋ถ„๊ธฐ ๋งŒ๋“ค๊ธฐ...] ํด๋ฆญ → master ํด๋ฆญ → Branch ์ด๋ฆ„ ์ ๊ธฐ

 

 

 

12. [์ƒ์„ฑ ํ›„ ๋ถ„๊ธฐ ๊ฒŒ์‹œ] ๋ˆŒ๋Ÿฌ๊ฐ€๋ฉฐ ๊ฐ™์€ ๋ฐฉ๋ฒ•์œผ๋กœ master, sub1, sub2, sub3 ์ด 4๊ฐœ์˜ branch ์ƒ์„ฑ

 

 

 

 

 

 

 

๐Ÿค— Push ํ•˜๊ธฐ (์ฝ”๋“œ ์˜ฌ๋ฆฌ๊ธฐ)

13. ('๋‚˜ ์ž์‹ '์ด sub1 branch๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ๋กœ ์•ฝ์†์ด ๋˜์–ด์žˆ์œผ๋ฉด) ์ขŒ์ธก ํ•˜๋‹จ์— branch name ํด๋ฆญ ํ›„ sub1 ํด๋ฆญ

 

 

 

 

14. ํŒŒ์ผ ์ƒ์„ฑ (์ž‘์—…)

 

 

 

 

 

15. [์†Œ์Šค์ œ์–ด] ํด๋ฆญ → ๋ณ€๊ฒฝ ์‚ฌํ•ญ์— [+] ํด๋ฆญ ํ•˜๋ฉด 

 

 

 

 

 

16. ๋ณ€๊ฒฝ ์‚ฌํ•ญ์— ์žˆ๋˜ ์ž‘์—…๋‚ด์šฉ์ด ์Šคํ…Œ์ด์ง•๋œ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์œผ๋กœ ์ด๋™. 

๋ฉ”์„ธ์ง€ ์ฐฝ์— ๊ฐ„๋žตํ•œ ๋ฉ”์„ธ์ง€๋ฅผ ๋ฐ˜๋“œ์‹œ ์ž‘์„ฑ ํ›„ ์ปค๋ฐ‹ ํด๋ฆญ (๋ฉ”์„ธ์ง€ ์ž‘์„ฑ ์•ˆํ•˜๋ฉด ์—๋Ÿฌ๋œธ) → ๊ฒŒ์‹œ

 

 

 

 

 

 

* 16-1. ๋ช…๋ น์–ด๋กœ๋„ ๊ฐ€๋Šฅ! ํ„ฐ๋ฏธ๋„ ์ฐฝ ์—ด๊ณ  ์ˆœ์„œ๋Œ€๋กœ ๋ช…๋ น์–ด ์ž…๋ ฅ

  1. git add .
  2. git commit -m “๋ฉ”์„ธ์ง€ ์ž…๋ ฅ”
  3. git push origin sub1(๋ณด๋‚ด๋ ค๋Š” branch name)

 

 

 

 

 

 

17. Github์— ์—…๋ฐ์ดํŠธ๋œ ๋‚ด์šฉ์ด ๋œจ๊ณ  Compare & pull request ํด๋ฆญ

 

 

 

 

 

โ˜…โ˜…โ˜…โ˜…โ˜… 18. ๋ฐ˜๋“œ์‹œ base๋ฅผ master branch๋กœ ๋ณ€๊ฒฝ ํ•ด์•ผํ•จ. (default main branch ์‚ฌ์šฉ ๊ธˆ์ง€) 

 

 

 

 

19. description์— ์ž‘์—…ํ•œ ๋‚ด์šฉ, ์ƒ์„ฑ, ์ˆ˜์ •, ์‚ญ์ œ ๋“ฑ ๊ณต์œ ํ•  ๋‚ด์šฉ์„ ์ž์„ธํžˆ ์ ๊ณ  Create pull request ํด๋ฆญ

 

 

 

 

 

20. Merge pull request ํด๋ฆญ

 

 

 

 

 

21. Confirm merge ํด๋ฆญ

 

 

 

 

 

22. master branch์— pull & merge ์™„๋ฃŒ

 

 

 

 

 

๐Ÿ˜‰ Pull ํ•˜๊ธฐ (์ฝ”๋“œ ๋‚ด๋ ค๋ฐ›๊ธฐ)

 

23. ์ขŒ์ธก ํ•˜๋‹จ์— master๋กœ branch ๋ณ€๊ฒฝ ํ›„ [๋ณ€๊ฒฝ ๋‚ด์šฉ ๋™๊ธฐํ™”] ํด๋ฆญ → ํ™•์ธ

 

 

 

 

24. ์ขŒ์ธกํ•˜๋‹จ์— branch๋ฅผ sub1 ๋กœ ๋ณ€๊ฒฝํ•œ๋’ค [์ƒˆํ„ฐ๋ฏธ๋„] ์—ด๊ณ  git pull origin master ์ ์–ด์ฃผ๋ฉด ๋

 

 

 

728x90
๋ฐ˜์‘ํ˜•

+ Recent posts