I am applying bunches of commits using cherry-pick
:
git rev-list --reverse something-begin..something-end | git cherry-pick --stdin
and then ends up with error message:
...
You are currently cherry-picking commit xxxyyy.
nothing to commit, working tree clean
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:
git commit --allow-empty
If you wish to skip this commit, use:
git reset
Then "git cherry-pick --continue" will resume cherry-picking the remaining commits.
I dont want to pick any of these empty commits.
It is very annoying to have to git reset; git cherry-pick --continue
each time it stops and prompts.
Why isn't there a --skip-empty
option? I checked my git version 2.9.3
and found its cherry-pick
does not support --skip-empty
or --empty-commpit=skip
or any other similar option.
I do see that git rev-list
has an option --remove-empty
but it just did not work for me.
Finally I found the solution.
git rev-list --reverse something-begin..something-end . | git cherry-pick --stdin
Adding a dot to rev-list
command (that is the path parts) will skip all empty commits for me (what is --remove-empty
for??)