I get a strange error:
git cherry-pick a0cd8fe
fatal: bad revision 'a0cd8fe'
Why is that?
Note that the branch that a0cd8fe was merged to has been deleted. Is that why I get this error?
That is because you don't have the remote branch (from where you want to cherry-pick) locally
Solution
git fetch origin <remote_branch>
git cherry-pick <commit_id>
Just deleting a branch does not remove any commits. Immediately afterwards, any git command will work when given the SHA hash of a commit that was on the deleted branch. These so-called orphaned commits are eventually garbage collected after a set amount of time. From your output, it assists that this is what has happened. After garbage collection, the commit is permanently deleted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With