If you're cherry picking from one pushed (or will-be-pushed) branch of your codebase to another (pushed or will-be-pushed), the command you're looking for is...

git cherry-pick -x <commit-hash>

From the git docs:
-x
When recording the commit, append a line that says "(cherry picked from commit โ€ฆโ€‹)" to the original commit message in order to indicate which commit this change was cherry-picked from. This is done only for cherry picks without conflicts. Do not use this option if you are cherry-picking from your private branch because the information is useless to the recipient. If on the other hand you are cherry-picking between two publicly visible branches (e.g. backporting a fix to a maintenance branch for an older release from a development branch), adding this information can be useful.
The warning about private branches only makes sense: If that SHA is never shared, the value isn't useful.

If the only person to see your repo is yourself, I'm not sure if the SHA falling in the cherry treed woods makes a sound or not. Probably up to the SHAer.

Labels: ,