๐Ÿ‘ฉ‍๐Ÿ’ป/Git

[Github] ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ/๋กœ์ปฌ ๋˜๋Š” ๋ฆฌ๋ชจํŠธ์—์„œ ๋ธŒ๋žœ์น˜ ์‚ญ์ œ

ํ•œ๋‚˜ 2021. 4. 13. 00:51

์ด๋ฒˆ ํ”„๋กœ์ ํŠธ์—์„œ๋Š” Github์˜ ํ”„๋กœ์ ํŠธ ๊ธฐ๋Šฅ์„ ์ •๋ง ์ž˜ ํ™œ์šฉํ•˜๊ณ  ์žˆ๋‹ค. Pull Request์™€ Issue ํŠธ๋ž™ํ‚น, ์นธ๋ฐ˜ ๋ณด๋“œ๋กœ ์Šค์ผ€์ฅด๋ง ๋“ฑ๋“ฑ ์ฝ”๋“œ์™€ ์ง์ ‘์  ๊ด€๋ จ์ด ์žˆ๋Š” ์‚ฌํ•ญ์€ ์ด๊ณณ์— ์ž˜ ๊ธฐ๋กํ•ด๋‘๊ณ , ์ผ์ • ๊ด€๋ฆฌ์— ๋Œ€ํ•œ ๋ถ€๋ถ„์€ ๋…ธ์…˜์— ์˜์กดํ•˜๊ณ  ์žˆ๋‹ค. Git์— ๋Œ€ํ•ด์„œ๋„ ์ƒˆ๋กญ๊ฒŒ ๋งŽ์ด ๋ฐฐ์šฐ๋Š” ๊ฒŒ ์žˆ๋‹ค. ๊ฐ€๋ น, ํ˜„์žฌ๊นŒ์ง€๋Š” ํŒ€์›๋ณ„๋กœ ํ•˜๋Š” ์ผ์ด ๊ฒน์น˜์ง€ ์•Š์•„์„œ ๊ฐ์ž์˜ ๋ธŒ๋žœ์น˜๋ฅผ ๋”ฐ์„œ ์ž‘์—…ํ–ˆ๋‹ค๋ฉด, ์ด์ œ ๊ฒน์น˜๋Š” ์ฝ”๋“œ๊ฐ€ ๋งŽ์•„์ ธ์„œ ๊ธฐ๋Šฅ๋ณ„๋กœ ๋ธŒ๋žœ์น˜๋ฅผ ๋”ฐ์„œ ์ž‘์—…ํ•˜๊ณ  ๊ทธ๋•Œ๊ทธ๋•Œ ๋ณ‘ํ•ฉํ•˜๊ณ  ์‚ญ์ œํ•˜๋Š” ์‹์ด๋‹ค.

๊ด€์Šต๋Œ€๋กœ feature/[๊ธฐ๋Šฅ]์œผ๋กœ ๋ธŒ๋žœ์น˜ ์ด๋ฆ„์„ ์ ์–ด์ค€๋‹ค. ์˜ค๋Š˜์€ register ์‹œ Formik์™€ Yup ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•œ Validation์„ ํ…Œ์ŠคํŠธํ•ด๋ณผ ์ผ์ด ์žˆ์–ด์„œ ๊ฐ€์ด๋“œ ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“œ๋Š๋ผ feature/register๋ผ๋Š” ์ด๋ฆ„์œผ๋กœ ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ–ˆ๋‹ค.

๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•  ๋•Œ๋Š” ๊ธฐ์ค€์ด ๋˜๋Š” ๋ธŒ๋žœ์น˜๋กœ ์šฐ์„  checkout ์ด๋™ ํ•œ ํ›„, ๋ธŒ๋žœ์น˜๋ฅผ ์ƒˆ๋กœ ๋”ฐ์ค€๋‹ค.

 

# git checkout <branchWhereYouWantToCopy>
git checkout develop

# git branch <branchname>
git branch feature/register

 

์‹ค์ˆ˜๋กœ ๋‹ค๋ฅธ ๋ธŒ๋žœ์น˜๋ฅผ ๋”ฐ์™€์„œ ์ž‘์—…ํ•  ๊ฒฝ์šฐ์—๋Š” ๋ธŒ๋žœ์น˜๋ฅผ ๋‹ค์‹œ ์‚ญ์ œํ•ด์ฃผ๋ฉด ๋œ๋‹ค. ๋กœ์ปฌ์—์„œ ์‚ญ์ œํ•ด์ค„ ๋•Œ๋Š” ์•„๋ž˜ ๋ฐฉ๋ฒ•์„ ์ด์šฉํ•œ๋‹ค.

 

git branch -d <branchYouWantToRemove>

 

๋งŒ์ผ ์ธ์ง€ ํ•˜์ง€ ๋ชปํ•˜๊ณ  push๊นŒ์ง€ ํ•ด์„œ remote ์ €์žฅ์†Œ์—์„œ ์‚ญ์ œํ•ด์ฃผ์–ด์•ผ ํ•  ๊ฒฝ์šฐ์—๋Š” ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.

 

git push origin --delete <branchYouWantToRemove>

 

์‚ญ์ œ ๋ช…๋ น์–ด ๋Œ€์‹  delete ํ”Œ๋ž˜๊ทธ๋ฅผ ์ด์šฉํ•ด git pushํ•œ๋‹ค. 

 

ํ˜„์žฌ ๋ธŒ๋žœ์น˜๋ฅผ ์กฐํšŒํ•  ๊ฒฝ์šฐ์—๋Š” git branch๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.