๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿคผ Git

[๐Ÿคผ Git] Github ์˜คํ”ˆ์†Œ์Šค ๊ธฐ์—ฌํ•ด๋ณด๊ธฐ

by Fomagran ๐Ÿ’ป 2021. 12. 28.
728x90
๋ฐ˜์‘ํ˜•

 

์•ˆ๋…•ํ•˜์„ธ์š” Foma ๐Ÿ’ป  ์ž…๋‹ˆ๋‹ค!

 

์˜ค๋Š˜์€ ์˜คํ”ˆ์†Œ์Šค์— ๊ธฐ์—ฌํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค!

 

๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~


1. ๊ธฐ์—ฌํ•  ์˜คํ”ˆ์†Œ์Šค ์ฐพ๊ธฐ

 

ํ‰์†Œ ์ž๊ธฐ๊ฐ€ ๊ด€์‹ฌ์ด ์žˆ๊ฑฐ๋‚˜, ๊ธฐ์—ฌํ•ด๋ณด๊ณ  ์‹ถ์€ ๊ณต๊ฐœ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ฅผ ์ฐพ์Šต๋‹ˆ๋‹ค.

 

(์ €๋Š” iOS ๋ฉด์ ‘์งˆ๋ฌธ์„ ์ •๋ฆฌํ•˜๋Š” iOS-Dev-Career ๋ผ๋Š” ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ฅผ ์„ ํƒํ–ˆ์Šต๋‹ˆ๋‹ค.)


2. ๋‚ด ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋กœ ๊ฐ€์ ธ์˜ค๊ธฐ

 

๋ ˆํฌ์ง€ํ† ๋ฆฌ ์šฐ์ธก ์ƒ๋‹จ์— ๋ณด๋ฉด Fork๋ผ๊ณ  ์ ํ˜€์žˆ์„๊ฑฐ์—์š”.

 

ํ•ด๋‹น ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ์„œ ๋‚ด ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋กœ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.

 

 

๊ฐ€์ ธ์˜ค๋ฉด ์ž์‹ ์˜ ๊นƒํ—™์— ๋ ˆํฌ์ง€ํ† ๋ฆฌ๊ฐ€ ๋งŒ๋“ค์–ด์ง„ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 


3. ๋กœ์ปฌ๋กœ ๋ ˆํฌ์ง€ํ† ๋ฆฌ ๋ณต์‚ฌํ•ด์˜ค๊ธฐ

 

์œ„์—์„œ ๊ฐ€์ ธ์˜จ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ฅผ ๋กœ์ปฌ(์ž์‹ ์˜ ์ปดํ“จํ„ฐ)์— ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.

 

ํ„ฐ๋ฏธ๋„์„ ์ผœ๊ณ  ์›ํ•˜๋Š” ์œ„์น˜๋กœ ์ด๋™ํ•œ ๋’ค ์•„๋ž˜์™€ ๊ฐ™์ด git clone ๋ณต์ œํ•œ ๊นƒํ—™ ์ฃผ์†Œ๋ฅผ ์ ์–ด์ค๋‹ˆ๋‹ค.

 

$ git clone <๋ณต์ œํ•œ ๊นƒํ—™ ์ฃผ์†Œ>

 

์ฃผ์†Œ๋Š” Code ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

ํด๋ก ์ด ์™„๋ฃŒ๋˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ํด๋”๊ฐ€ ๋ณต์ œ๋œ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 


4. ์›๋ž˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ ์ •๋ณด ์ถ”๊ฐ€ํ•ด์ฃผ๊ธฐ

 

์œ„์˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋Š” ์ œ ๊นƒํ—™(origin)์—์„œ ๋‹ค์šด๋ฐ›์€ ์ƒํƒœ์ด๊ธฐ ๋•Œ๋ฌธ์— ํ˜„์žฌ ์›๋ž˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ(upstream)์˜ ์ •๋ณด๋ฅผ ์•Œ ์ˆ˜๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.

 

๊ณ ๋กœ ํ˜„์žฌ ํด๋” ์œ„์น˜๋กœ ์ด๋™ํ•ด์„œ ์›๋ž˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ ์ •๋ณด๋ฅผ ์ถ”๊ฐ€ํ•ด์ค๋‹ˆ๋‹ค.

 

$ git remote add upstream git://github.com/<์›๋ž˜ ์ฃผ์ธ ์ด๋ฆ„>/<๋ ˆํฌ์ง€ํ† ๋ฆฌ ์ฃผ์†Œ>

5. ๋‚ด๊ฐ€ ์ž‘์—…ํ•  ๊ณต๊ฐ„ ๋งŒ๋“ค๊ธฐ

 

์ด์ œ ๋ณต์ œํ•œ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— ์ œ๊ฐ€ ๊ธฐ์—ฌํ•  ๊ณต๊ฐ„์„ ๋งŒ๋“ค์–ด ์ค˜์•ผ๊ฒ ์ฃ ?

 

์ž์‹ ๋งŒ์˜ ๊ณต๊ฐ„์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด์„  ์ž์‹ ์˜ branch๋ฅผ ์ƒ์„ฑํ•ด ์ค˜์•ผํ•ฉ๋‹ˆ๋‹ค.

 

์•„๋ž˜์™€ ๊ฐ™์ด git checkout -b ์›ํ•˜๋Š” ๋ธŒ๋žœ์น˜ ์ด๋ฆ„์„ ์ •ํ•ด์ฃผ๊ณ  ์ƒ์„ฑํ•ด์ค๋‹ˆ๋‹ค.

 

 

git checkout -b <์›ํ•˜๋Š” ๋ธŒ๋žœ์น˜ ์ด๋ฆ„>

6. ๋‚ด ๋ธŒ๋žœ์น˜์— ํ‘ธ์‰ฌํ•˜๊ธฐ

 

์ด์ œ ์ž์‹ ์ด ๊ธฐ์—ฌํ•  ๋ถ€๋ถ„์„ ์ž‘์—…ํ•˜๊ณ  ์œ„์—์„œ ๋งŒ๋“  ์ž์‹ ์˜ ๋ธŒ๋žœ์น˜์— ์ปค๋ฐ‹ ํ›„ ํ‘ธ์‰ฌํ•ด์ค๋‹ˆ๋‹ค.

 

$ git add --all
$ git commit -m "์ปค๋ฐ‹ํ•  ๋‚ด์šฉ"
$ git push origin <์ž์‹ ์˜ ๋ธŒ๋žœ์น˜ ์ด๋ฆ„>


7. ๋ ˆํฌ์ง€ํ† ๋ฆฌ ์ฃผ์ธ์—๊ฒŒ ๊ฒ€์ˆ˜ ์š”์ฒญํ•˜๊ธฐ

 

์œ„์—์„œ ์ž‘์—…ํ•œ ๊ฒƒ๋“ค์„ ์›๋ž˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— ํ•ฉ์น˜๊ธฐ ์œ„ํ•ด์„  ์›๋ž˜ ์ฃผ์ธ์˜ ํ—ˆ๋ฝ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

 

(๋งŒ์•ฝ ์ด์ƒํ•œ ๊ฒƒ๋“ค์„ ์ž‘์—…ํ•ด๋†“๊ณ  ํ•ฉ์ณ๋‹ฌ๋ผ ์š”์ฒญํ•˜๋ฉด ํ•ด๋‹น ๋ ˆํฌ์ง€ํ† ๋ฆฌ๊ฐ€ ๋ง๊ฐ€์ง€๊ฒŒ ๋˜๊ฒ ์ฃ ?)

 

์ด์ œ ์ž์‹ ์˜ ๊นƒํ—™์— ์žˆ๋Š” ํ•ด๋‹น ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋กœ ์ด๋™ํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด Compare & pull request ๋ฒ„ํŠผ์ด ์žˆ์„๊ฑฐ์—์š”.

 

์ด๊ฑด "์ƒˆ๋กญ๊ฒŒ ์—…๋ฐ์ดํŠธ๋œ ์ž‘์—…์ด ์žˆ๋Š๋‹ˆ๊น ๊ฒ€์‚ฌ๋งก์•„๋ด" ๋ผ๊ณ  ํ•˜๋Š” ๊ฒƒ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 

์ž์‹ ์ด ์ž‘์—…ํ•œ ์‚ฌํ•ญ๋“ค์„ md ๋ฌธ๋ฒ•์— ๋งž์ถฐ์„œ ์ ์–ด์ค๋‹ˆ๋‹ค.

 

์›๋ž˜์˜ ์ฃผ์ธ์˜ ํ—ˆ๋ฝ์„ ๋งก์œผ๋ ค๋ฉด ์ตœ๋Œ€ํ•œ ์„ธ์„ธํ•˜๊ฒŒ ์ ๋Š”๊ฒŒ ์ข‹๊ฒ ์ฃ ?

 

 

๋งŒ์•ฝ ์ฃผ์ธ์ด ํ—ˆ๋ฝ์„ ํ–ˆ์œผ๋ฅด ๊ฒฝ์šฐ ์ž์‹ ์ด ์ž‘์—…ํ•œ ๊ฒƒ๋“ค์ด ์›๋ž˜์˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— ํ•ฉ์ณ์ง€๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

 

 

์›๋ž˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์˜ Contributors์— ์ถ”๊ฐ€๋˜๋Š” ๊ฒƒ๋„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 


8. ์ž์‹ ์˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ ์—…๋ฐ์ดํŠธ ํ•˜๊ธฐ

 

์œ„์—์„œ ์›๋ž˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— ์ž์‹ ์˜ ์ž‘์—…ํ•œ ๊ฒƒ๋“ค์ด ํ•ฉ์ณ์กŒ์ฃ ?

 

์ด์ œ ๊ทธ ํ•ฉ์ณ์ง„ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋กœ ์ž์‹ ์˜ ๊นƒํ—™์— ๋ณต์ œํ•œ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ฅผ ์—…๋ฐ์ดํŠธ ํ•ด์ค˜์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

๋ณต์ œํ•œ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋กœ ์ด๋™ํ•˜๋ฉด ์šฐ์ธก ์ƒ๋‹จ์— Fetch upstream์ด๋ผ๊ณ  ์žˆ์„๊ฑฐ์—์š”.

 

๊ฑฐ๊ธฐ์„œ Fetch and merge๋ฅผ ๋ˆŒ๋Ÿฌ์„œ ์—…๋ฐ์ดํŠธ ํ•ด์ค๋‹ˆ๋‹ค.

 

 

์ด๋ ‡๊ฒŒ ์—…๋ฐ์ดํŠธ๋ฅผ ํ•ด์ฃผ๋ฉด ์ž์‹ ์˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์—๋„ ์ž์‹ ์ด ๊ธฐ์—ฌํ•œ ๊ฒƒ๋“ค์ด ํ•ฉ์ณ์ง„ ๋ชจ์Šต์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 


P.S

 

์˜ˆ์ „๋ถ€ํ„ฐ ์–ธ์  ๊ฐ€๋Š” ์˜คํ”ˆ์†Œ์Šค์— ๊ธฐ์—ฌํ•ด ๋ด์•ผ๊ฒ ๋‹ค ๋‹ค์ง์€ ํ–ˆ์—ˆ๋Š”๋ฐ ๋ญ”๊ฐ€ ์˜คํ”ˆ์†Œ์Šค์— ๊ธฐ์—ฌํ•œ๋‹ค๋Š”๊ฒŒ ์—„์ฒญ๋‚œ ์‹ค๋ ฅ์„ ๊ฐ€์ ธ์•ผ๋งŒ ํ•  ์ˆ˜ ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ์—ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ md ํŒŒ์ผ์„ ์ˆ˜์ •ํ•˜๊ฑฐ๋‚˜ ๊ฐ„๋‹จํ•œ ์˜ค๋ฅ˜๊ฐ™์€ ๊ฒƒ๋งŒ ์ˆ˜์ •ํ•˜๋Š” ๊ฒƒ๋„ ๊ธฐ์—ฌํ•˜๋Š” ํ™œ๋™์ด์—ˆ๋‹ค. ๋‚ด๊ฐ€ ์ž‘์—…ํ•œ ๊ฒƒ์ด ๋‹ค๋ฅธ ์‚ฌ๋žŒ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— ํ•ฉ์ณ์ง„ ๊ฒƒ์„ ๋ณด๋‹ˆ ๋ญ”๊ฐ€ ์‹ ๊ธฐํ•˜๊ณ  ๋ฟŒ๋“ฏํ–ˆ๋‹ค..ใ…Ž ์ด์ œ ์ž์‹ ๊ฐ๋„ ์–ป์—ˆ์œผ๋‹ˆ ์ •๋ง ์•Œ๋ ค์ง„ ์˜คํ”ˆ์†Œ์Šค์— ์ฝ”๋“œ๋กœ ๊ธฐ์—ฌํ•ด๋ณด๋Š” ๊ฒƒ์„ ๋ชฉํ‘œ๋กœ ์‚ผ์•„์•ผ๊ฒ ๋‹ค.


Reference

 

 

[ํ˜‘์—…์„ ์œ„ํ•œ git & GitHub] 2. ๋‹ค๋ฅธ ์‚ฌ๋žŒ์˜ ์›๊ฒฉ ์ €์žฅ์†Œ๋กœ๋ถ€ํ„ฐ ํ˜‘์—…ํ•˜๋Š” ๋ฐฉ๋ฒ•(Fork, clone, upstream, Pull Re

์•ˆ๋…•ํ•˜์„ธ์š” Steve-Lee์ž…๋‹ˆ๋‹ค. ์˜ค๋Š˜์€ 'ํ˜‘์—…์„ ์œ„ํ•œ git & GitHub' ๋‘ ๋ฒˆ์งธ ์‹œ๊ฐ„์œผ๋กœ ๋‹ค๋ฅธ ์‚ฌ๋žŒ์˜ ์›๊ฒฉ ์ €์žฅ์†Œ(Remote Repository)๋ฅผ ๊ฐ€์ ธ์™€ ํ˜‘์—…ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ๋‹ค๋ค„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. (๋‚ด์šฉ์ด ์กฐ๊ธˆ ๋งŽ์„

deepinsight.tistory.com

 

 

GitHub - sungeunDev/iOS-Dev-Career: iOS ๊ฐœ๋ฐœ ๋ฉด์ ‘ ์งˆ๋ฌธ์„ ์ •๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

iOS ๊ฐœ๋ฐœ ๋ฉด์ ‘ ์งˆ๋ฌธ์„ ์ •๋ฆฌํ•ฉ๋‹ˆ๋‹ค. Contribute to sungeunDev/iOS-Dev-Career development by creating an account on GitHub.

github.com

 

728x90
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€