How to make sure other people cannot edit my git notes?

I want to make release notes using git notes, but I'm not sure other people change my git notes using the same ref.

BTW, chmod 444 .git/refs/notes/abc_test and .git/logs/refs/notes/abc_test does not work.

+4
source share
2 answers

I don't think you can really protect published git notes.

What you can do is put them in an explicit namespace, as mentioned here :

I think that for "typical use" everyone stores the notes of others in a different place, for example. I keep Thomas lists in refs / remotes / trast / notes / so that they do not interfere with my own notes.

If in the same namespace, then they can be combined :

 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 will change their content.

+2
source

This Git man page details the removal of sensitive data and states that you can

add [file] to .gitignore to make sure it is not accidentally re-committed

I do not think it is possible to have a file with a version, but not visible to others, due to the use of the distributed Git model. Setting up a read-only file will not have the desired effect after copying the file to another user repository.

Does this answer your question?

+1
source

Source: https://habr.com/ru/post/1443394/


All Articles