So from my understanding cherry-picking a commit from one branch to another creates a completely new hash signature although the actual code changes are the same. I believe this is because the commit hash signature depends upon the branch name and commit time among other things.
Because of this I have been led to believe that if a bug fix has been made in a feature branch and another developer needs this fix, the correct solution is to cherry pick this fix into its own branch, and merge that branch into the common branch both the feature branches branched from. Then the original bufix commit in the feature branch should be deleted and finally both feature branches simply re-base on-top of the common branch which now contains the bugfix.
However, it seems this is not how others interpret using cherry-pick. I thought that if a commit is cherry-picked from one feature branch into another and both are merged back into common, then these separate commits cause one of three things to happen;
- 'duplicate' commits in the history which introduce the same code changes
- a merge conflict that has to be handled manually
- introduction of duplicated lines of code.
Have I interpreted cherry pick incorrectly?