๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • What would life be If we had no courage to attemp anything?
๐“๐จ๐๐š๐ฒ ๐ˆ ๐‹๐ž๐š๐ซ๐ง

๐“๐จ๐๐š๐ฒ ๐ˆ ๐‹๐ž๐š๐ซ๐ง 2022.08.04.๋ชฉ

by DevIseo 2022. 8. 4.

๐“๐จ๐๐š๐ฒ ๐ˆ ๐‹๐ž๐š๐ซ๐ง 2022.08.04.๋ชฉ

์ง€๋‚œ ์ผ์ฃผ์ผ ๊ฐ„ ๋งŒ๋‚ฌ๋˜ git merge conflict

 

git pull ๋ฐ›์•„์™”์„ ๋•Œ git conflict -- MERGING

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

์ถฉ๋Œ๋œ ํŒŒ์ผ์— ๋“ค์–ด๊ฐ€๋ฉด ์ถฉ๋Œ์ด ์ผ์–ด๋‚œ ๋ถ€๋ถ„์ด ๋‚˜์˜ค๋Š”๋ฐ

<<<HEAD… ์œ—๋ถ€๋ถ„์„ ๋ณด๋ฉด ์˜ต์…˜๋“ค์ด ์žˆ๋Š”๋ฐ

์ฒซ๋ฒˆ์งธ ์˜ต์…˜์€ ํ˜„์žฌ ๋‚ด ์ฝ”๋“œ ๊ทธ๋Œ€๋กœ ์œ ์ง€/ ๋‘๋ฒˆ์งธ๊ฐ€ ๋ฐ”๋€ ์ฝ”๋“œ๋กœ ๋ณ€๊ฒฝํ•˜๋Š” ๊ฒƒ (์ž๊ธฐ๊ฐ€ ์›ํ•˜๋Š” ์˜ต์…˜ ํด๋ฆญ)

์ˆ˜์ •ํ•œ ํŒŒ์ผ์„ ์ €์žฅ ํ›„ ํ„ฐ๋ฏธ๋„์—์„œ

git add .
git commit

์ˆ˜์ •๋ชฉ๋ก์ด ๋๋‚  ๋•Œ ๊นŒ์ง€ enterํ‚ค๋ฅผ ๋ˆŒ๋Ÿฌ ์ด๋™ ํ›„

i๋ฅผ ๋ˆŒ๋Ÿฌ ์ˆ˜์ •๋ชจ๋“œ๋กœ ๋“ค์–ด๊ฐ€ commit ๋ฉ”์‹œ์ง€๋ฅผ ์“ด ํ›„

esc๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ ์ˆ˜์ •๋ชจ๋“œ๋ฅผ ๋น ์ ธ๋‚˜์˜จ ํ›„

:wq ์ž…๋ ฅ ํ›„ ์—”ํ„ฐํ•˜๋ฉด merge๊ฐ€ ๋จ!

 

git pull์‹œ git conflicts ์ˆ˜์ •ํ•  ์ˆ˜ ์—†๋Š” ํŒŒ์ผ๋“ค ๊ฐ•์ œ๋กœ ๋ฎ์–ด์”Œ์šธ๋•Œ

(cannot merge binary files)

https://nochoco-lee.tistory.com/117

https://stackoverflow.com/questions/278081/resolving-a-git-conflict-with-binary-files

//๋ฐ›์•„์˜ค๋Š” ํŒŒ์ผ๋กœ ๋ฎ์–ด์”Œ์šธ๋•Œ
git checkout --theirs --[์ถฉ๋Œ ํŒŒ์ผ]

//์›๋ž˜ ํŒŒ์ผ๋กœ ๋ฎ์–ด์”Œ์šธ๋•Œ
git checkout --ours --[์ถฉ๋ŒํŒŒ์ผ]

//ํŒŒ์ผ์ด ๋„ˆ๋ฌด ๋งŽ์•„์„œ ํŒŒ์ผ์„ ๋‹ค ๋ฎ์–ด ์”Œ์šฐ๊ณ  ์‹ถ๋‹ค๋ฉด
git checkout --theirs .
git checkout --ours .

 

git add .
git commit

 

i
<commit ๋ฉ”์‹œ์ง€ ์ž‘์„ฑ>
esc๋ฒ„ํŠผ
:wq
enter

 

๋Œ“๊ธ€