๐ [Git]forkํ branch ์ต์ ๋ฒ์ ์ผ๋ก ์ ๋ฐ์ดํธํ๊ธฐ
์ฌ๋๋ค๊ณผ ํ์ ํ๋ค ๋ณด๋ฉด ๋ฐฐํฌ๋๋ ์ฝ๋๊ฐ ๊ผฌ์ด๊ฑฐ๋ ๋๋ฌ์์ง์ง ์๊ฒ ๊ฐ์ ์์ ๋ง์ repository๋ฅผ ๋ง๋ค๊ณ forkํ์ฌ ์์ ํ ์ค์ฌ repository์ PR์ ๋ณด๋ด mergeํ ๋๊ฐ ์๋ค. ๋ค๋ฅธ ์ฌ๋์ PR์ด merge๋ ํ ์ถฉ๋๋์ง ์๊ธฐ ์ํด์ ๋์ repostiory์ ์ต์ ๋ฒ์ ์ ์ค์ฌ repostiory๋ฅผ ์ ๋ฐ์ดํธํด์ผํ๋ค. ์๋์ผ๋ก ์ ๋ฐ์ดํธํ๋ ๋ฐฉ์๋ ์์ง๋ง ์ด ๊ธ์์ ์๋์ผ๋ก ์ ๋ฐ์ดํธํ๋ ๋ฐฉ๋ฒ์ ๋ํด ์๊ธฐํ๋ ค ํ๋ค.
upstream(forkํ branch)์ remote๋ก ๋ฑ๋กํ๋ค.
git remote add upstream "upstream git ์ฃผ์"
upstream ๋ด์ฉ์ fetch (์ต์ ๋ฒ์ ์ผ๋ก ์ ๋ฐ์ดํธํ๋ค๋ ๋ป)
git fetch upstream
๋ด ๋ธ๋์น์ upstream ๋ธ๋์น๋ฅผ ๋ณํฉํ๋ค.
# ๊ฐ์ ๋ธ๋์น์์
git merge upstream/{๋ธ๋์น ์ด๋ฆ}
# develop ๋ธ๋์น๋ฅผ ์
๋ฐ์ดํธํ๊ณ ์ถ๋ค๋ฉด
git checkout develop # ๋ธ๋์น๊ฐ ์๋ค๋ฉด git checkout -b develop
git merge upstream/develop
๋ด ์๊ฒฉ repository์ ์ต์ ๋ฒ์ ์ repository๋ฅผ pushํ๋ค.
git push origin {๋ธ๋์น ์ด๋ฆ}
forkํ branch ์ต์ ๋ฒ์ ์ผ๋ก ์ ๋ฐ์ดํธํ๊ธฐ