I want to make release notes by using git notes, but I am not sure if other people change my git notes by using the same ref.
BTW, chmod 444 .git/refs/notes/abc_test
& .git/logs/refs/notes/abc_test
does not work.
I want to make release notes by using git notes, but I am not sure if other people change my git notes by using the same ref.
BTW, chmod 444 .git/refs/notes/abc_test
& .git/logs/refs/notes/abc_test
does not work.
I don't think you really can protect published git notes.
What you can do is put them in an explicit namespace, as mentioned in here:
I think for "typical usage" one stores others' notes in a different place anyways, e.g. I store Thomas' list-notes in refs/remotes/trast/notes/ so that they don't interfer with my own notes.
If in the same namespace, then they can be merged:
git checkout refs/notes/commits
git fetch origin refs/notes/commits
git merge FETCH_HEAD
git update-ref refs/notes/commits HEAD
git checkout master
But that would change their content.
This Git man page details how to remove sensitive data and it states that you can
add [the file] to the .gitignore to ensure it is not accidentally re-committed
I do not think that it is possible to have a file versioned, but not visible to others, due to the distributed model Git uses. Setting the file to read only will not have the desired effect once the file is copied to another user's repository.
Does that answer your question?
In the same way you protect your own repository: don’t let anyone else push to it.
But since you are asking this then it might be the case that you are already in a shared repository. And while you can probably selectively “protect” certain branches, you can (probably) not do the same for specific refs like notes.
Then the only thing you can do is to make another (remote) repository somewhere else and push the notes thataway. Then tell people that the release notes are in another repository.