git - 如何确保其他人不能编辑我的 git 笔记?

标签 git readonly

我想使用 git notes 来做发行说明,但我不确定其他人是否使用相同的 ref 更改了我的 git notes。

顺便说一句,chmod 444 .git/refs/notes/abc_test & .git/logs/refs/notes/abc_test 不起作用。

最佳答案

我不认为你真的可以保护已发布的 git 笔记。

你可以做的是将它们放在显式的 namespace 中,如前所述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.

如果在同一个命名空间中,那么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

但这会改变他们的内容。

关于git - 如何确保其他人不能编辑我的 git 笔记?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13174215/

相关文章:

linux - 设置 CRAMFS 文件系统的权限

wpf - XAML只读组合框

ruby-on-rails - 当你有 git post-receive hook 时,Rails 为什么要使用 capistrano?

git - 在终端 SSH 中获取当前路径的 url

windows - git clone 在 git shell 中工作,但在 windows 命令行中不工作

c# - 集合上下文中 ReadOnlyCollection string[] 之间的区别

javascript - 切换输入只读说明

bash - 为什么 ". myscript"仅在 Windows sh.exe 的一个 Git 中返回文件未找到?

java - Eclipse (Oxygen) 在访问 EGit 时停止响应?

javascript - Greasemonkey 将 Readonly 从 True 更改为 False