gitcherry-pick

How to cherry-pick with a comment non interactively?


I have a script which cherry-picks a commit while adding more information to the comment. Today I run git cherry-pick and then git commit --amend to modify the commit message.

I can see there is the -e flag, but it seems to be interactive. Is there a way to run git cherry-pick with a message non interactively?


Solution

  • I decided to invoke git cherry-pick with the --no-commit flag. Then I commit explicitly with the new message. Currently I do not see a better solution.