51 questions
65 votes
3 answers
33k views
Can I add metadata to git commits? Or can I hide some tags in gitk
I want to associate custom metadata with a git commit. Specifically to record a review ID from a code review but it could be anything. Tags seem a natural way to do that but I expect to have a ...
3 votes
1 answer
126 views
How to keep git notes through a rewrite (rebase/rename/amend)?
I have added some notes to commits using git notes add <hash> -m potato But when I rebase or amend the commits, the note is not copied over to the new rewritten commit. According to the docs ...
3 votes
1 answer
169 views
git notes in oneline git log format [duplicate]
When running git log to list commits with notes, it seems like the notes end with an extra newline. Example output with two commits where only the second one has a note: $ git log --pretty="%ad %...
2 votes
1 answer
170 views
List all git notes for given object
I am playing around with using git notes to store metadata after a commit gets merged. For example, if a commit causes nightly CI to fail and later gets reverted, I would do: $ commit=123 $ git notes ...
2 votes
2 answers
853 views
Is git notes the intended way to add category-style information to a commit?
The answer to Can I add metadata to git commits? Or can I hide some tags in gitk mentions git notes as a way to add metadata to a git commit. Is git notes, possibly taking advantage of its namespace ...
0 votes
1 answer
548 views
git overrides refs/notes when fetching?
I'm keeping my changelog in git-notes --ref changelog when developing. I'm always putting a note on the merge-to-master commit and push it out to three remotes (git push <remote> refs/notes/...
4 votes
3 answers
359 views
How can I sign Git notes?
Git notes are a feature to add meta-information to Git objects. See this Stackoverflow article for further details. Similar to commits, I also want to sign notes. My local Git is configured to sign ...
1 vote
2 answers
112 views
When editing git notes, how can I keep lines that start with "#"?
If I use git notes --ref=$REF edit $COMMIT, original message is: Notes (xxx): #NEW path/to/file1: your message path/to/file2: your message #TEST path/to/file3: your message Then the message ...
7 votes
1 answer
4k views
Adding Git notes to a blob
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 ...
7 votes
3 answers
4k views
Git: Get all notes of a branch
We'd like to annotate our commits with git notes add, which works fine. To get a list of all commits with notes we use this command git notes | cut -d' ' -f2 | xargs -ihash git log hash -1 Now we ...
2 votes
2 answers
184 views
Is there any easier way to edit git notes?
Is there any other way to edit git notes, like setting default editor etc, rather than git notes --ref=$ABC edit $COMMIT.
3 votes
1 answer
579 views
Add tags / label to git commits
I have a branching strategy where I have a branch that represent each of my org. Now when working on a branch , we can have commits for a release or a hotfix correction etc... I want to be able to tag/...
4 votes
2 answers
310 views
Git: How to retrieve all commits from all branches without notes?
I need to retrieve all commits from all branches. I retrieve them using command: git log --pretty="%H %f" --all But in this case Git returns me all commits with notes, if such exist. I tried to use ...
4 votes
1 answer
129 views
Using multiple branches of git notes
I am looking to use git notes to store benchmarking data of commits so I can maintain a history of a project's performance. I know I can use git notes to attach metadata to commits, but I would like ...
82 votes
1 answer
21k views
git: how to push messages added by git notes to the central git server?
it seems like there is no proper documentation regarding git notes. I have added some notes to one of the commit using git notes add command. but when i push the commit, and later do a separate clone, ...