0

I met a problem when I cherry-pick a commit on my branch. Below is what I did:

$ git cherry-pick  50658
$ git status

Error messages:

Not currently on any branch.
You are currently cherry-picking commit 5065872.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)

        both modified:      drivers/media/dvb-core/dvb_frontend.c

But when I input git diff. It tells below :

diff --cc drivers/media/dvb-core/dvb_frontend.c
index 7023d5f,72fc718..0000000
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c

I didn't find any conflict massage, as <<<<<<HEAD in dvb_frontend.c files. Why it tells conflicts exiting ?

Huy Nguyen
  • 2,025
  • 3
  • 25
  • 37
Wen Zhu
  • 1
  • 1
  • Possible duplicate of [How to resolve merge conflicts in Git?](http://stackoverflow.com/questions/161813/how-to-resolve-merge-conflicts-in-git) – 1615903 Mar 31 '17 at 04:13

1 Answers1

0

When you are in the middle of a conflict; you should not use git diff; you should use any editor you like to resolve the conflicts, then

git add <filename>

at that moment you can use

git diff --cached

to see what your final commit will actually look like. When that is ok for you; you can use

git cherry-pick --continue

to finalize the commit you are cherry-picking.

Chris Maes
  • 35,025
  • 12
  • 111
  • 136
  • I used vim command,but found no HEAD>>>>> marker. I don't know why. – Wen Zhu Mar 31 '17 at 07:27
  • the markers just start with `<<<<<` , `=====` and `>>>>>`... just search for that – Chris Maes Mar 31 '17 at 07:41
  • did you retry from the start? It's hard to believe you are still cherry-picking after 5 days. To make sure: `git cherry-pick --abort` to abort any cherry-pick that is happening. Make sure `git status` says everything is ok. then retry your `git cherry-pick ` and if any conflict arises just open up the conflicting file and search for the `<<<<<` markers – Chris Maes Apr 06 '17 at 10:06
  • I have this same issue. Are you using VS Code? –  Dec 11 '18 at 16:24