Note senza riscrittura
git notes allega metadati arbitrari ai commit esistenti senza cambiare i loro SHA. Review, stati di build, sign-off, metriche di performance — qualsiasi cosa si voglia associare a un commit puo vivere nelle note.
Aggiungere e modificare
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>
Usare namespace
git notes --ref=builds add -m "build #1234 OK" <sha>
git notes --ref=reviews add -m "LGTM" <sha>
git config notes.displayRef "refs/notes/*"
Mostrare nel log
git log --notes
git log --show-notes=builds
git log --pretty=format:'%h %s%n%N' --notes
Condividere le note
git config --add remote.origin.fetch '+refs/notes/*:refs/notes/*'
git fetch
git push origin 'refs/notes/*'
Caso d'uso: annotazioni CI
git notes --ref=ci add -m "duration=312s status=pass coverage=87%" <sha>
git push origin refs/notes/ci
Fondere note
git notes merge -s union refs/notes/origin/commits
Errori comuni
Aspettarsi che le note viaggino con git push automaticamente — non lo fanno.