51 questions
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, ...
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 ...
55 votes
3 answers
85k views
git: How to delete a local ref branch?
I have bit of a difficulty in deleting a local ref branch(refs/notes/origin/commits). I was able to delete the branch(refs/notes/origin/commits) in the remote repository using the command git push ...
19 votes
1 answer
5k views
Fetch git notes when cloning
I know that git notes can be fetched after cloning using: git fetch origin refs/notes/*:refs/notes/* or even be setup in git config to be always fetched. However at clone time I do not get the notes,...
17 votes
1 answer
8k views
Git notes details
I've read this and this but still see them as obscure. By far understood: creation (git notes add -m "a note") notes are namespaced Questions: notes seem not to create a commit, so how the push (...
16 votes
3 answers
9k views
How to get the tree hash for a given directory name?
I'd like to attach a note to a tree object. However, in order to do so I first need to know the tree object's hash. For a given directory name that's part of my repository, how do I get its belonging ...
15 votes
1 answer
2k views
Is there a way to automatically merge notes if commits for those notes get squashed?
For example: git commit -am "Something" git notes append -m "Dark " git commit -am "Something" git notes append -m "Side" git rebase -i # now I squash two commits and I expect to see "Dark Side" ...
13 votes
1 answer
784 views
Preserve git notes when rewriting history with git filter branch
For some reasons, I have to rewrite the entire history of my git repository to change the committer_id of every commit. However, I attached a note to more or less every commit and using git-filter-...
10 votes
2 answers
3k views
Merging git notes when there are merge conflicts in them
I followed these instructions in order to merge Git notes. I cloned a repo, added notes reference to the commit (refs/notes/commits). When i push it, central repo rejects it as it was non-fast forward—...
9 votes
2 answers
5k views
Store custom metadata against individual files in a Git repository
I'm working with a Git repository and would like to define custom properties to apply to each file in the repository. These properties could then be updated on each commit. Ideally the properties ...
8 votes
4 answers
2k views
Filter git log to show only commits with notes
How can I dump a log of my commits showing only the ones with notes of a given namespace? Commits without notes, or notes not belonging to a given namespace should be filtered out In the text dump I ...
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 ...
7 votes
3 answers
1k views
Find commit with specific git note
I use git notes in my repository. Sometimes I need to find a commit with note that includes given string. So far I was using this command: git log --show-notes=* --grep="PATTERN" --format=format:%H ...
7 votes
2 answers
678 views
git notes after BFG?
I migrated from SVN to git and i had a note in each git commit referencing to SVN revision number. After repo import i used BFG repo cleaner to clean git history from binary files and other trash. ...