I am trying to realize a use-case using git.
Use Case : It should be possible to add metadata (like Attributes) to git artifacts.
We plan to have a git repo for each component, so applying a note for each commit object could realize this requirement.
Now, it is also required that we have metadata for files within a component (git repo in this case). For this i tried to attach a note to a blob which was part of a commit.
It accepts the note and even I am able to push the notes to central repo.
Is this a safe and reliable usage of git notes for this use-case?
2012: Yes, you can use git notes that way.
The blog post "Git Tip of the Week: Git Notes" from Alex Blewitt reminds us about some of the
git notesadvantages and gotcha:The "note to self" article also points out how pushing/pulling notes isn’t exactly easy.
Beside those two issues (merging and pushing), you should be ok with your ‘
git notes‘ use case.Note: With Git 2.39 (Q4 2022), avoid a stray empty newline in the template when creating new notes.
See commit 3c9b01f (16 Nov 2022) by Michael J Gruber (
mjg).(Merged by Junio C Hamano —
gitster— in commit 2fe427e, 23 Nov 2022)