상세 컨텐츠

본문 제목

[git] conflict 가 발생하였을 때 해결 방법

Handy/[etc]

by Astro Smurf 2014. 7. 14. 21:11

본문

1. 가장 최신의 git 을 새로 받는다. 


2. 수정된 내용의 cherry-pick 을 가지고 온다.  그러면 아래와 같이 error 가 발생할 것이다. 


$ git fetch [ cherry-pick ]

remote: Counting objects: 9, done

remote: Finding sources: 100% (5/5)

remote: Total 5 (delta 3), reused 5 (delta 3)

Unpacking objects: 100% (5/5), done.

From ssh://---

 * branch            refs/changes/64/29964/3 -> FETCH_HEAD

error: could not apply a2e8212...  

hint: after resolving the conflicts, mark the corrected paths

hint: with 'git add <paths>' or 'git rm <paths>'

hint: and commit the result with 'git commit'



3. 그러면 수정된 파일을 열어가지고, 내가 덮어쓸 commit 내용으로 수정한다. 

 


4. git add [수정된파일]

 


5. git commit -c a2e8212 // 이 숫자는 위에 error 발생지점을 참고하자.

 


6.  git push origin master:refs/for/master


끝!

관련글 더보기