๐Ÿค ์€์ง€log ๐Ÿค

[Git] branch ์ƒ์„ฑ ๊ณผ ์ „ํ™˜ ๋ฐฉ๋ฒ• ๋ณธ๋ฌธ

๐Ÿฅ TIP

[Git] branch ์ƒ์„ฑ ๊ณผ ์ „ํ™˜ ๋ฐฉ๋ฒ•

Eun_zii 2022. 12. 6. 14:14

๐Ÿ”† Branch ์ƒ์„ฑ

// only ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ

git branch [Branch Name]

 

// ์ƒ์„ฑ๊ณผ ์ „ํ™˜ ๋™์‹œ์— ์ฒ˜๋ฆฌ

git checkout -b [Branch Name]

 

// ์ƒ์„ฑ๊ณผ ์ „ํ™˜ ๋™์‹œ์— ์ฒ˜๋ฆฌ

git switch -c [Branch Name]

 

๐Ÿ”† Branch ์ „ํ™˜

๐Ÿ’ก switch ์™€ checkout ์œผ๋กœ ์ „ํ™˜ํ• ๋•Œ,

branch๊ฐ€ ์—†์œผ๋ฉด ์ „ํ™˜ํ•˜์ง€ ๋ชปํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์œ„ ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ์˜ git checkout -b ์™€ git switch -c ๋กœ ๋ธŒ๋žœ์น˜ ์ƒ์„ฑํ›„ ์ „ํ™˜ํ•ด์•ผ ํ•œ๋‹ค.

์•„๋ž˜ ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ๋Š” ์ด๋ฏธ branch๊ฐ€ ์ƒ์„ฑ๋˜์–ด ์žˆ๊ณ  ์ „ํ™˜ํ•ด์•ผํ•˜๋Š” ๊ฒฝ์šฐ์— ์‚ฌ์šฉํ•œ๋‹ค.

 

git switch [Branch Name]

 

git checkout [Branch Name]
728x90