Reputation: 2491
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, i dont see the note message there. Is there a way to push all the note messages added via git notes command?
Upvotes: 80
Views: 20166
Reputation: 2568
The answer is very well articulated by Simont but just wanted to introduce you to git notes binary.
git notes add -m "MY_NOTE_MESSAGE" HASH_OF_COMMIT
git push origin refs/notes/*
Upvotes: -2
Reputation: 72667
Push all notes:
git push <remote> 'refs/notes/*'
Fetch all notes:
git fetch origin 'refs/notes/*:refs/notes/*'
A word of warning: do not use git pull
in place of git fetch
(that is, git pull origin refs/notes/*:refs/notes/*
is wrong). The overall details are complex, but the particular reason git pull
is wrong here is that you do not want to merge or rebase refs/notes/commits
with your current branch.
Note: The quoting above is important to avoid expansion of the *
shell wildcard.
Upvotes: 91