Currently if I add notes to an object in git I have to explicitly push/pull this information to the remote server.
Is it possible to configure git so that when I do a git push
it will push my local notes changes as well as any local source changes?
Likewise for git pull.
Yes for git pull
, no for git push
.
You can fetch notes:
[remote "origin"]
fetch = +refs/notes/*:refs/notes/*
fetch = +refs/heads/*:refs/remotes/origin/*
but, as mentioned in "Note to Self" (2010, but I don't think this has changed):
However, you can push anything under '
refs/
' to a server, you just need to be more explicit about it. If you run this it will work fine:
$ git push origin refs/notes/bugzilla
In fact, you may want to just make that
git push origin refs/notes/*
which will push all your notes.
This is what Git does normally for something like tags. When you rungit push origin --tags
it basically expands togit push origin refs/tags/*
.
git push
doesn't push all tags by default (see "Why git doesn't push tags by default?").git push
doesn't push all notes for the same reason.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With