๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ’ป DEV/GitHub

[Github] main branch๋ฅผ master ๋กœ ๋ฐ”๊พธ๊ณ  default ๊ฐ’ ๋ณ€๊ฒฝํ•˜๊ธฐ

by Rising Oneโ˜… 2024. 8. 2.
728x90
๋ฐ˜์‘ํ˜•
SMALL

 

Github ๋กœ๊ณ 

 

 

Git Flow strategy์„ ํ†ตํ•ด ํ”„๋กœ์ ํŠธ ํ˜‘์—…-ํ˜•์ƒ๊ด€๋ฆฌ๋ฅผ ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. 

Git์—์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•  ์‹œ, main(default) ๋ธŒ๋žœ์น˜๊ฐ€ ์ƒ์„ฑ์ด ๋ฉ๋‹ˆ๋‹ค.

master, develop, release ๋ธŒ๋žœ์น˜ ๋“ฑ์ด ํ•„์š”ํ•œ ๊ฐ€์šด๋ฐ, main ๋ธŒ๋žœ์น˜๋ฅผ master ๋ธŒ๋žœ์น˜๋กœ ๋ฐ”๊พธ๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.

 

์š”์•ฝ

  1. ์ฒซ ๋ฒˆ์งธ ๋ฐฉ๋ฒ• (web์ƒ์—์„œ ๋ณ€๊ฒฝ)

 

  2. ๋‘ ๋ฒˆ์งธ ๋ฐฉ๋ฒ• (command๋กœ ๋ณ€๊ฒฝ)


์ƒ์„ธ

  1. ์ฒซ ๋ฒˆ์งธ ๋ฐฉ๋ฒ• (web์ƒ์—์„œ ๋ณ€๊ฒฝ)

 

์ฒซ ๋ฒˆ์งธ ๋ฐฉ๋ฒ•์€ Github(web)์—์„œ ๋ณ€๊ฒฝ์ž…๋‹ˆ๋‹ค.

โ—ผ๏ธŽ 1) ๋ธŒ๋žœ์น˜๋ช…์„ ๋ฐ”๊พธ๊ณ ์ž ํ•˜๋Š” ํ”„๋กœ์ ํŠธ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ๋กœ ์ง„์ž…์„ ํ•ฉ๋‹ˆ๋‹ค.

โ—ผ๏ธŽ 2) settings > General ์— ์ง„์ž…ํ•ฉ๋‹ˆ๋‹ค.

โ—ผ๏ธŽ 3) 'Default branch' ์„น์…˜์—์„œ main ๋ธŒ๋žœ์น˜๋กœ ์„ค์ •๋ผ ์žˆ์Œ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

โ—ผ๏ธŽ 4) '์—ฐํ•„' ์•„์ด์ฝ˜์„ ํด๋ฆญํ•ด ๋ช…์นญ์„ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค. (ํƒ€๋ธŒ๋žœ์น˜๊ฐ€ ์กด์žฌํ•œ๋‹ค๋ฉด, ์Šค์œ„์นญ ์•„์ด์ฝ˜์œผ๋กœ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.)


  2. ๋‘ ๋ฒˆ์งธ ๋ฐฉ๋ฒ• (command๋กœ ๋ณ€๊ฒฝ)

 

โ—ผ๏ธŽ 1) ํ˜„์žฌ main ๋ธŒ๋žœ์น˜์ž„์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. (git branch)
โ—ผ๏ธŽ 2) main ๋ธŒ๋žœ์น˜์˜ ์ด๋ฆ„์„ master๋กœ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.
git branch -m main master

 

โ—ผ๏ธŽ 3) ์›๊ฒฉ์ €์žฅ์†Œ๋กœ ํ‘ธ์‹œํ•ฉ๋‹ˆ๋‹ค.

git push origin master

 

โ—ผ๏ธŽ 4) ์›๊ฒฉ์ €์žฅ์†Œ์—์„œ ๊ธฐ์กด์˜ ๋ธŒ๋žœ์น˜๋ฅผ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.

git push origin --delete main
728x90
๋ฐ˜์‘ํ˜•
LIST

๋Œ“๊ธ€