When you cherry-pick commits from a branch into master and later merge that branch, Git may see the cherry-picked commits as new (different hashes) and try to apply them again.
To avoid duplicates, rebase the feature branch onto master before merging:
git checkout feature-branch
git rebase master
git checkout master
git merge feature-branch
During the rebase, Git automatically skips commits whose changes are already in master, so the merge happens cleanly without duplicate commits.