How do you `git cherry-pick --continue` with `--no-verify`?

Viewed 7567

How do you git cherry-pick --continue with --no-verify since --no-verify is not a valid option. git cherry-pick --no-commit --continue does not work since those two parameters are mutually exclusive.

2 Answers

If your cherry-pick (without --no-commit) had merge conflicts and you want to --continue after solving them, you can temporarily disable git hooks for the current repo with:

$ git config core.hooksPath # Print current setting
$ git config core.hooksPath '/dev/null/'

After you're done, depending on whether core.hooksPath was set before, you can either restore the previous setting:

$ git config core.hooksPath '/some/previous/path'

or unset it again:

$ git config --unset core.hooksPath

--no-verify is an option for the commit command, not cherry-pick.

However what you can do is to use the --no-commit flag for your cherry-pick, then git commit --no-verify is fine to conclude the cherry-pick.

Related