It's exactly what it says: the changes you're trying to cherry-pick are already wholly contained in the branch you're on. I.e. the result of the cherry-pick is no changes. You can create an empty commit with the --allow-empty
flag to indicate that you attempted to cherry-pick, but there were no changes to pull in.
why is git-cherrypick saying nothing to commit
-
13-12-2021 - |
Frage
I googled a lot for the below issue but couldn't get any substantial info...please help me out,created a temporary branch 202116 and am trying to do a cherrypick of gerrit 202116 and I get the below message,why am I not able to cherry-pick this gerrit and why am I getting this error?please provide your inputs
<>git fetch ssh://company@company.com:29418/platform/vendor/company-proprietary/radio refs/changes/25/202116/1 && git cherry-pick FETCH_HEAD
From ssh://company.com:29418/platform/vendor/company-proprietary/radio
* branch refs/changes/25/206025/1 -> FETCH_HEAD
# On branch 202116
# You are currently cherry-picking.
# (all conflicts fixed: run "git commit")
#
nothing to commit, working directory 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
Lösung
Andere Tipps
This could be caused by trying to cherry pick a commit that was already integrated/cherry-picked into your current branch.
I don't know why you do a cherry-pick
after fetch
, Because you may cherry-pick the same commit with your HEAD
.
And is git checkout
what you really want? I guess.
I got this message when I misread my Bitbucket diff page, mistaking the parent commit for the commit I wanted. Thus I was attempting to cherry-pick the parent commit which was already on my working branch - so there was indeed "nothing to commit".