Want to add context to old commits without rewriting history? Git notes attach metadata to any commit.
Add Note to Commit:
# Add note to last commit git notes add -m "Reviewed by John. Deployed to staging 2024-03-15" # Add note to specific commit git notes add -m "This fixed the prod outage on Black Friday" abc1234 # Edit existing note git notes edit abc1234
View Notes:
# See note with commit git log --show-notes # Show specific commit with note git show abc1234
Share Notes:
# Push notes git push origin refs/notes/commits # Fetch notes from remote git fetch origin refs/notes/commits:refs/notes/commits
Use Cases: Code review comments, deployment records, bug references, QA notes
Add context without touching commit history!
