Notes ohne Umschreiben
git notes hangt beliebige Metadaten an existierende Commits an, ohne ihre SHAs zu andern. Reviews, Build-Status, Sign-offs, Performance-Metriken.
Hinzufugen und Bearbeiten
git notes add -m "Reviewed by team Phoenix" <sha>
git notes append -m "QA passed" <sha>
git notes edit <sha>
git notes show <sha>
git notes remove <sha>
Namespaces verwenden
git notes --ref=builds add -m "build #1234 OK" <sha>
git notes --ref=reviews add -m "LGTM" <sha>
git config notes.displayRef "refs/notes/*"
Im Log anzeigen
git log --notes
git log --show-notes=builds
git log --pretty=format:'%h %s%n%N' --notes
Notes teilen
git config --add remote.origin.fetch '+refs/notes/*:refs/notes/*'
git fetch
git push origin 'refs/notes/*'
Anwendungsfall: CI-Annotationen
git notes --ref=ci add -m "duration=312s status=pass coverage=87%" <sha>
git push origin refs/notes/ci
Notes mergen
git notes merge -s union refs/notes/origin/commits
Haufige Fehler
Erwarten, dass Notes mit git push automatisch reisen — tun sie nicht.