notes 

Send to Kindle
home » snippets » git » notes



Snippets

# The default namespace is called "commits"
git notes add -m 'something about this commit' $SHA
git show -s $SHA  # equivalent to git show --no-patch $SHA

# You can specify a different namespace as well.
git notes --ref=bugzilla add -m 'buganizer notes' $SHA

# You must specify the non-default namespace to display for git log.
git log --show-notes=bugzilla

# Or show notes from all namespaces
git log --show-notes='*'

# You can override the default namespace to use this way.
# 1.  Set "core.notesRef" to refs/notes/bugzilla in git config.
# 2.  export GIT_NOTES_REF=refs/notes/bugzilla
#
# For display:
# 1.  Set "notes.displayRef" in the git config.
# 2.  export GIT_NOTES_DISPLAY_REF=refs/notes/bugzilla

# Push all notes to origin.
git push origin 'refs/notes/*'

# Push only bugzilla notes to origin.
git push origin refs/notes/bugzilla

# Fetching notes.
git fetch origin refs/notes/*:refs/notes/*