์ƒ๊ฐ์ •๋ฆฌ

git fork ์—ฐ๊ฒฐ ๋ฐฉ๋ฒ•

dev_summer 2021. 3. 4. 10:23

์—ฌ๋Ÿฟ์ด์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ํ•˜๋Š” ๊ฒฝ์šฐ ํ•œ๊ฐœ์˜ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ์—์„œ ๋ธŒ๋žœ์น˜๋ฅผ ๋”ฐ์„œ ํ’€ํ‘ธ์‹œํ•ด๋„๋˜์ง€๋งŒ

fork๋ฅผ ๋”ฐ์„œ ๋‚˜์˜ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ์—์„œ ๊ด€๋ฆฌํ• ์ˆ˜๋„ ์žˆ๋‹ค.

 

 

git ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ์˜ ์šฐ์ธก์ƒ๋‹จ์˜ fork๋ฅผ ํด๋ฆญํ•˜๋ฉด ๋‚˜์˜ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ๋กœ ๋ณต์ œ๊ฐ€ ๋œ๋‹ค.

๋‚˜์˜ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ์—์„œ ์ˆ˜์ •์„ ํ•œ ๋’ค ์›๋ณธ๊ณผ ๋จธ์ง€ํ• ์ˆ˜๋„์žˆ๊ณ  

์›๋ณธ์˜ ๋‚ด์šฉ์„ ๋‚˜์˜ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ์™€ ๋™๊ธฐํ™” ์‹œ์ผœ์ฃผ๋Š” ์ž‘์—…๋˜ํ•œ ๊ฐ€๋Šฅํ•˜๋‹ค.

 

 

* ์ถ”๊ฐ€ ๋‚ด์šฉ

remote -v์„ ํ•˜๊ฒŒ๋˜๋ฉด ์ด 4๊ฐœ์˜ ๋ฆฌ๋ชจํŠธ๋ฅผ ๋ณผ์ˆ˜์žˆ๋‹ค.

upstream์œผ๋กœ 2๊ฐœ, origin์œผ๋กœ 2๊ฐœ

remote add origin ํฌํฌ๋ฐ›์€git์ฃผ์†Œ

๋ฅผ ํ•œ ๋’ค ํฌํฌ๋ฐ›์€ ๋‚˜์˜ ๊นƒ์— ๋กœ๋“œํ•œ ๋’ค ๊ธฐ์กด์˜ ๊นƒ์— ๋จธ์ง€ํ•˜๋Š” ํ˜•์‹์œผ๋กœ ์ž‘์—…ํ•˜๋ฉด ๋œ๋‹ค. 

git remote add upstream --์ฃผ์†Œ
git remote -v : remote ํ•ญ๋ชฉ์ด ๋‚˜์˜ด
git remote remove upstream : ์—…์ŠคํŠธ๋ฆผ ๋ฆฌ๋ชจํŠธ ์‚ญ์ œ
git fetch upstream : ์—…์ŠคํŠธ๋ฆผ ํ•ญ๋ชฉ ๋ณด๊ธฐ
git merge upstream/master : ๋™๊ธฐํ™”