How it works...

We fetched the notes. The reason why it works is because of the way we fetched them. By default, Git is configured to fetch refs/heads/* into refs/remotes/origin/*. This way, we can easily keep track of what is remote and what is local. The branches in our local repository are in refs/heads/*. These branches are also listed when you execute git branch.

For notes, we need to fetch refs/notes/* into refs/notes/* since we want to get the notes from the server and use them with the git show, git log, and git notes Git commands.

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.