Notas sin reescribir
git notes adjunta metadatos arbitrarios a commits existentes sin cambiar sus SHAs. Reviews, estados de build, sign-offs, métricas de rendimiento — cualquier cosa que quieras asociar a un commit puede vivir en notas. Se almacenan en la ref especial refs/notes/commits por defecto.
Añadir y editar
git notes add -m "Revisado por equipo Phoenix" <sha>
git notes append -m "QA pasó" <sha>
git notes edit <sha>
git notes show <sha>
git notes remove <sha>
Usar namespaces
git notes --ref=builds add -m "build #1234 OK" <sha>
git notes --ref=reviews add -m "LGTM" <sha>
git config notes.displayRef "refs/notes/*"
Mostrar en log
git log --notes
git log --show-notes=builds
git log --pretty=format:'%h %s%n%N' --notes
Compartir notas
git config --add remote.origin.fetch '+refs/notes/*:refs/notes/*'
git fetch
git push origin 'refs/notes/*'
Caso de uso: anotaciones de CI
git notes --ref=ci add -m "duration=312s status=pass coverage=87%" <sha>
git push origin refs/notes/ci
Hacer merge de notas
git notes merge -s union refs/notes/origin/commits
Errores comunes
Esperar que las notas viajen con git push automáticamente — no lo hacen. Configura refspecs explícitamente.