develop에 있는 것을 master에 merging(정확히 말하면 rebase) 하다가 failed가 되었다. conflict를 잡고 해결하는 팁을 정리.

 

(master) $ git rebase develop
First, rewinding head to replay your work on top of it...
Applying: changed db connections number.
Using index info to reconstruct a base tree...
<stdin>:15: trailing whitespace.
blah
<stdin>:27: trailing whitespace.
blah

<stdin>:28: trailing whitespace.
blah

warning: 3 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging 절대파일주소

CONFLICT (content): Merge conflict in 절대파일주소
Auto-merging 절대파일주소
CONFLICT (content): 절대파일주소
Failed to merge in the changes.
Patch failed at 0001 changed db connections number.

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".

 

 

  [git는 설명이 잘 되어 있어서 잘 눈여겨 봐야한다.]

 

((67cccd4...)|REBASE) $ git status
# Not currently on any branch.
# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#       both modified:      절대파일 주소
#       both modified:      절대파일 주소
#
no changes added to commit (use "git add" and/or "git commit -a")

 


[eclipse에 eGit가 깔려있다면. 쉽게 확인 가능. conflct 난 소스 변경. diff로 볼 수 있다. ]

 

image

 

 

merging 작업을 실시한다.

 

$ git add .

 

$ git rebase --continue
Applying: changed db connections number.

 

$ git status
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 4 and 1 different commit(s) each, respectively.
#
nothing to commit (working directory clean)

 

 

   [different commit 이 있다고 상세한 설명을 해준다. push가 아닌 commit을 먼저 해준다]

 

$ git commit
[master c863385] Merge branch 'master' of git 주소

 

$ git push
Counting objects: 18, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 1.13 KiB, done.
Total 8 (delta 3), reused 0 (delta 0)
remote: => Syncing Gitorious... [OK]
To git 주소
   9c6b980..c863385  master -> master

 

깔끔히 merging됨.

 

이제. develop도 똑같이 해서 master에 맞게 동기화 해줌.

Posted by '김용환'
,