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—because there was already a refs/notes/commits for that commit object. So in order to merge that remote Notes reference to my local Notes reference,
$ git checkout refs/notes/master
$ git fetch refs/notes/commits
$ git merge FETCH_HEAD
Auto-merging 206155715a78c9d91d42cda1de98449d2e0b1d36<br>
CONFLICT (add/add): Merge conflict in 206155715a78c9d91d42cda1de98449d........
Automatic merge failed; fix conflicts and then commit the result.
$ vi 206155715a78c9d91d42cda1de98449d........ [fix the conflict as usual manually]
$ git add 206155715a78c9d91d42cda1de98449d........
$ git commit -m "updated Notes"
[detached HEAD 0afb80f] changed notes
$ git update-ref refs/notes/commits HEAD
$ git checkout master <br>
Previous HEAD position was 0afb80f... changed notes
Switched to branch 'master'
$ git push origin refs/notes/commits
success
The question is, whether is this the best way to do this?
Following git notes man page, I tried the following.
$ git fetch refs/notes/commits
$ git notes merge -v refs/notes/commits
Nothing to Update!
The above steps obviously didn’t work for me. Is there a way to use the git notes merge command and merge the Notes, rather than the "branch method" as shown in the first illustration? For my uses, this straightforward command would be more helpful.