MapleStory Finger Point

๐ŸŸ  Git

[Git] comflict ์ถฉ๋Œ

HYEJU01 2024. 6. 12. 09:38

 

  • comflict ๋ž€? 

comflict ๋Š” ๊ฐ™์€ ํŒŒ์ผ, ๊ฐ™์€ ์œ„์น˜๋ฅผ ์—ฌ๋Ÿฌ ์‚ฌ์šฉ์ž๊ฐ€ ๋™์‹œ์— ์ˆ˜์ •ํ•  ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜์ด๋‹ค.

merge / rebase ์ž‘์—… ์ค‘ ์ž๋™์œผ๋กœ ํ•ด๊ฒฐํ•  ์ˆ˜ ์—†๋Š” ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ์žˆ์„ ๋•Œ ๋ฐœ์ƒํ•œ๋‹ค.

 

ex) 

1) A ๋ธŒ๋žœ์น˜์™€ B ๋ธŒ๋žœ์น˜๊ฐ€ ์žˆ๋‹ค.

2) ๋‘ ๋ธŒ๋žœ์น˜๋ฅผ ๋™์ผํŒŒ์ผ, ๋™์ผ ๋ผ์ธ์„ ์ˆ˜์ •ํ•จ 

3) A ๋กœ ์ฒดํฌ์•„์›ƒํ•˜์—ฌ B ๋ฅผ ๋ณ‘ํ•ฉํ•œ๋‹ค (merge)---> <comflict ๋ฐœ์ƒ !!!>

Automatic merge failed; fix conflicts and then commit the result. 

<<<<<<< HEAD
์ด ๋ถ€๋ถ„์€ A ๋ธŒ๋žœ์น˜์˜ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.
=======
์ด ๋ถ€๋ถ„์€ B ๋ธŒ๋žœ์น˜์˜ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.
>>>>>>> B-branch

 

 

  • comflict ๋ฐœ์ƒ ์‹œ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•

comflict ๋ฐœ์ƒํ•œ ํŒŒ์ผ์„ ์ˆ˜๋™์œผ๋กœ ์ˆ˜์ •ํ•ด์ฃผ๋ฉด ๋œ๋‹ค.

๋”๋ณด๊ธฐ

pull ๋‹น๊ฒจ์˜ค๋ฉด comflict ๋ฐœ์ƒ >

์“ฐ๋˜ ์ฝ”๋“œ๋ฅผ add / commit >

pull (comflict ๋ฐœ์ƒ) >

comflict ํŒŒ์ผ ๋ชฉ๋ก ํ™•์ธ ํ›„ ์ˆ˜์ • >

๋‹ค์‹œ add/ commit  >

push 

 

 

1) ๋ณ‘ํ•ฉ ์‹œ comflict ๋ฐœ์ƒ
git status ๋กœ ํ™•์ธ ๊ฐ€๋Šฅ

<<<<<<< HEAD
์ด ๋ถ€๋ถ„์€ A ๋ธŒ๋žœ์น˜์˜ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.
=======
์ด ๋ถ€๋ถ„์€ B ๋ธŒ๋žœ์น˜์˜ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.
>>>>>>> B-branch

 

 

 

2) comflict ํŒŒ์ผ ๋ชฉ๋ก ํ™•์ธ ํ›„ ์ฝ”๋“œ ์ˆ˜์ •

์›ํ•˜๋Š” ๋ถ€๋ถ„๋งŒ ๋‘๊ณ  ๋‹ค ์ง€์›Œ์ค€๋‹ค.

 

์ด ๋ถ€๋ถ„์€ ์ˆ˜์ •๋œ ์ตœ์ข… ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.

 

 

 

3) ํŒŒ์ผ ์ถ”๊ฐ€ ๋ฐ ์ปค๋ฐ‹
add -> commit  -> push 

 

 


 

๋กœ์ปฌ ์ €์žฅ์†Œ (๋ณ€ํ™”) ์›๊ฒฉ ์ €์žฅ์†Œ
(๋ณ€ํ™”)
์‚ฌ์šฉ
O X git push origin master 
X O git pull origin master 
O O <comflict ๋ฐœ์ƒ>  

collabolator  /  pull request 

 

 

[Git] Pull Request & Collaborators

๐Ÿ“Pull Request   (PR)์ตœ์ƒ๋‹จ ๊ด€๋ฆฌ์ž์—๊ฒŒ  ์ฝ”๋“œ ์ˆ˜์ • ์ ์šฉ์„ ์š”์ฒญํ•œ๋‹ค. ( branch ์—์„œ ์ž‘์—… )๊ด€๋ฆฌ์ž๋งŒ ์Šน์ธ์„ ํ•  ์ˆ˜ ์žˆ๋‹ค ! (merge) 1) ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•  ๊ด€๋ฆฌ์ž์˜ ๊นƒํ—ˆ๋ธŒ(์›๊ฒฉ) ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ ๋งํฌ๋กœ ๋“ค

hyejux.tistory.com

 

 


  • comflict ๋ฐœ์ƒ ๋ฐฉ์ง€
  1. ๋™์‹œ์— ๋™์ผํ•œ ํŒŒ์ผ์„ ์ˆ˜์ •ํ•˜์ง€ ์•Š๋Š”๋‹ค !!
  2. ์ž์ฃผ ๋ณ‘ํ•ฉํ•ด์„œ ๋ธŒ๋žœ์น˜ ๊ฐ„ ์ฐจ์ด๋ฅผ ์ตœ์†Œํ™” ํ•œ๋‹ค.
  3. ์ž‘์€ ๋‹จ์œ„๋กœ ์ปค๋ฐ‹ํ•˜์—ฌ ์ถฉ๋Œ ๋ฐœ์ƒ ์‹œ ํ•ด๊ฒฐ์ด ์šฉ์ดํ•˜๊ฒŒ ํ•œ๋‹ค.