git cherry-pick --continue, '--no-edit' option?
You can use:
git cherry-pick <sha1> --no-commit
after resolving conflict you can commit it from script.
Ofcourse you can set cherry-pick strategy-options to automatically resolve conflicts by accepting code from ours/theirs
Without that you'll get standard git markup of conflict
+<<<<<<< HEAD
some code
+||||||| parent of 4d64ec6... test commit
+ first version code
+=======
+ second version code
+>>>>>>> 4d64ec6... test commit
As Zildyan said in his answer, you will need to resolve all the conflicts before doing git add
. Therefore, you should not make this fully automated.
That said, to skip editing the commit message, you can simply set your editor to a command that does nothing and reports success. The ideal one on Unix-like systems is the true
command. Hence:
git -c core.editor=true cherry-pick --continue
will do the trick. (You can also use any of the environment variables GIT_EDITOR
, VISUAL
, or EDITOR
; and in fact, if any of those are set, you must use them rather than core.editor
since the sequence is: use $GIT_EDITOR
if that is set; else use $VISUAL
if that is set; else use $EDITOR
if that is set; else use core.editor
if that is set; else use whatever is built in to this version of Git.)