How to Push Git notes to a remote repository (Git)
Before we can push the notes from the shareNotes repository, we have to create a note to be pushed, as the notes we have now are all available on the remote repository. The remote repository in this case is the jgit directory:
Step 1 : You have found a commit you would like to add a note to, and you want to add the note to the verified reference:
git notes --ref verified add -m "Verified by firstname.lastname@example.org" 871ee53b52a
Step 2 : Now that we have added the note, we can list it with the git log command:
git log --notes=verified -1 871ee53b52a
Step 3 : To push the note, we must use the git push command, because the default push rule in Git is to push branches to refs/heads/<branchname>.
Step 4 : To push these notes, we need to push our note references to the remote notes, references. This can be done as follows:
git push origin refs/notes/*
Step 5 : Now, something happened; we have a new branch on the remote named refs/notes/verified. This is because we have pushed the notes to the remote. What we can do in order to verify it is go to the jgit directory and check whether the 871ee53b52a commit has a Git note:
cd ../jgit/ git log --notes=verified -1 871ee53b52a
We can see the note in this directory.