Skip to content

Instantly share code, notes, and snippets.

@hh-lohmann
Forked from topheman/git-notes.md
Last active August 28, 2026 10:33
Show Gist options
  • Select an option

  • Save hh-lohmann/79016b75a4651b5a2f8c1b6dac9b88a7 to your computer and use it in GitHub Desktop.

Select an option

Save hh-lohmann/79016b75a4651b5a2f8c1b6dac9b88a7 to your computer and use it in GitHub Desktop.
Git notes cheat sheet

Git notes

Warning: Support for display of Git notes has been dropped by GitHub: https://github.com/blog/707-git-notes-display

Add

git notes add
git notes add -m "my note"

Namespacing

Default namespace is commits

Use git notes --ref COMMAND

Examples:

git notes --ref jenkins add "build pass"
git notes --ref jenkins show HEAD
git log --show-notes=jenkins
git log --show-notes="*"

--show-notes="*" : Quotes are necessary so that * will be passed to git, not evalueted by the command line

Push

Like tags, notes aren't pushed by default.

git push origin refs/notes/commits
git push origin "refs/notes/*"

Fetch

Notes aren't fetched by default.

git fetch origin refs/notes/commits:refs/notes/commits
git fetch origin "refs/notes/*:refs/notes/*"

To fetch notes by default : vi .git/config

# edit this part

[remote "origin"]
  fetch = +refs/heads/*:refs/remotes/origin/*

# to become

[remote "origin"]
  fetch = +refs/heads/*:refs/remotes/origin/*
  fetch = +refs/notes/*:refs/notes/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment