I'm writing a script for migrating git repos. On cherry-pick conflicts I run
git add .
git cherry-pick --continue
This brings up vim, prompting me to save the commit message and freezes the script. I am looking for a command-line option like --no-edit
or --porcelain
to get around this.
Ugly terminal hacks might be welcomed as well ;)
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.)