Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get git to automatically update notes on the remote server when I do a git push/git pull

Tags:

git

git-notes

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.

like image 416
DaveG Avatar asked Jun 04 '13 15:06

DaveG


1 Answers

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 run git push origin --tags it basically expands to git 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.

like image 140
VonC Avatar answered Nov 15 '22 06:11

VonC