I have 3 branches dev, backup, and release. backup was created from dev, the release was created from backup. Now I have new changes in dev. only one commit should go in the release branch. so I am trying to use cherry-pick from dev to backup and then new PR from backup to release but I am getting errors while doing the same.
I am trying to use cherry-pick from one branch to another but getting the following error
E:\Java\Projects\Test-db\Test_db>git cherry-pick 876c951b5012e4ab87a9be9521
error: Commit 876c951b5012e4ab87a9be9521 is a merge but no -m option was given.
fatal: cherry-pick failed
Then by looking at this link [https://stackoverflow.com/questions/12626754/git-cherry-pick-syntax-and-merge-branches/12628579] I tried -m with cherrypick command but getting following
E:\Java\Projects\Test-db\Test_db>git cherry-pick -m 1 876c951b5012e4ab87a9be9521
On branch Java-develop-backup-2021-01-20
You are currently cherry-picking commit 876c951.
Untracked files:
mvn
nothing added to commit but untracked files present
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:
git commit --allow-empty
Otherwise, please use 'git reset'
E:\Java\Projects\Test-db\Test_db>
I tried git commit --allow-empty but it is opening following
#
# It looks like you may be committing a cherry-pick.
# If this is not correct, please remove the file
# .git/CHERRY_PICK_HEAD
# and try again.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Author: ABC Rokade <ABC.rokade@testcompnay.com>
# Date: Wed Jan 20 14:49:10 2021 +0000
#
# On branch Java-develop-backup-2021-01-20
# You are currently cherry-picking commit 876c951.
#
# Untracked files:
I am not sure what needs to do further. Could you please help me to resolve the error while using a simple cherry-pick command?