0

I'm performing a rebase of my feature branch with the master branch on a project. The rebase resulted with some conflicts (which is expected). I'm at stage when I need to resolve those conflicts and type git rebase --continue when that is ready. So, I have some files I committed in a state like:

<<<<<<<<< HEAD
[some code]
||||||| merged ancestors
[some code]
=========
[some code]
>>>>>>>>>> [Title of my commit]

Is it possible to resolve that with kdiff3 (or, if not, some other tool)? All what I found in Google was describing how to merge branches with this tool, but none mentioned rebase.

I'm working on Centos btw.

Limak
  • 1,511
  • 3
  • 12
  • 22
  • Are you still in the rebase and `git status` says "rebase in progress" and shows conflicted files? If so, the same method you use to run kdiff3 to merge when using `git merge` *should* work here. (I don't use kdiff3 at all so I'm not sure what methods people use to invoke it.) – torek Apr 27 '20 at 09:07
  • Thanks @torek, but I can't see how this can work. The method I would use will be `git merge branch_name && git mergetool --tool=kdiff3` and I can't use `git merge` at this point because it throws error `merge is not possible because you have unmerged files` – Limak Apr 27 '20 at 10:08
  • You don't need to run `git merge`: `git rebase` has run `git cherry-pick` which, internally, *is* a merge. In other words, `git merge` already started, then stalled out. Your job is now to finish the merge. (Technically rebase/cherry-pick uses `git merge-recursive` directly, rather than the front end `git merge` command, but it ends up in the same state.) – torek Apr 27 '20 at 18:46
  • You do, presumably, need to run `git mergetool` at this point, though. – torek Apr 27 '20 at 18:46
  • Yes, setting `git config merge.tool kdiff3` and running `git mergetool` worked as expected, thanks @torek. – Limak Apr 28 '20 at 11:21

0 Answers0