How to do it...

Imagine a situation where we have corrected a defect and did everything we could to ensure the quality of the commit before releasing it. Nonetheless, we had to make another fix for the same defect.

So, we want to add a note to the reference refs/notes/alsoCherryPick, which should indicate that if you cherry-pick this commit, you should also cherry-pick the other commits as they fix the same defect.

In this example, we will find the commit and add some extra information to the commit in multiple notes' reference specifications:

  1. Start by listing the top 10 commits on the branch so we have something to copy and paste from:
$ git log -10 --oneline
da6e87b Prepare post 3.1.0 builds
16ca725 JGit v3.1.0.201310021548-r
c6aba99 ...

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.