- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
如何配置 git 和 gitolite 以允许特定用户仅更改特定目录内的文件?
例如原始主分支中的文件:
/dir1/
/dir2/file1
/dir2/file2
/dir3/file1
用户 kathrine
,只允许更改 /dir2/file1
和 /dir2/file2
$kathrine: git clone git@example.com:test.git
结果:
/dir2/file1
/dir2/file2
gitolite.conf
中是否有任何 per-dir 指令,或者我应该为该用户配置 git 新分支吗?
我只是不想让图形设计师访问源代码文件。
最佳答案
2010:对于 Gitolite 2(对于 gitolite 3 可能已经改变)
否(意味着需要创建具有正确内容的专用分支)。
作为author of gitolite himself put it :
I am the author of a project called gitolite that does an excellent job of branch-level access control for multiple git repositories on a central server. My target "market" is precisely corporate users of git.
So far, I have not seen a situation where read-access needs to be restricted to ortions of a repo (git can't do that anyway).
[嗯sparse checkout可能会有帮助,但无论如何都不容易)
Write-access does often need to be restricted, and gitolite can let you restrict:
- both by branch name (e.g. only the QA lead can push a commit series into the "QA-done" branch)
- or by filename (e.g., only the team lead can make changes to the Makefile and files in
src/very-important-and-critical-module
).
请参阅“security, access control, and auditing”部分,这是一个写入 访问的示例:
conf/example.conf
file有所有详细的语法:
repo foo
RW+ = lead_dev # rule 1
RW = dev1 dev2 dev3 dev4 # rule 2
RW NAME/ = lead_dev # rule 3
RW NAME/doc/ = dev1 dev2 # rule 4
RW NAME/src/ = dev1 dev2 dev3 dev4 # rule 5
each file touched by the commits being pushed is checked against those rules.
- lead_dev can push changes to any files,
- dev1/2 can push changes to files in "
doc/
" and "src/
" (but not the top levelREADME
),- and dev3/4 can only push changes to files in "
src/
".
话虽如此,正如 OP 所说,棘手的问题仍然存在:
how do I create new branch witch some selected files only, and delete the previous commits, so the graphic designer could not access them, and see only the selected ones after the clone?
一般原则:
在那些文件不存在的历史点创建“graph_designer”分支。
从那里,有两个选择:
git rebase --interactive
),以便第一个只有 dir2
文件的提交(然后提交影响任何其他目录)“graph_designer
”将是唯一允许克隆的分支,并且不会包含任何未经授权文件的历史记录。
关于gitolite:只允许更改选定的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3204881/
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 8年前关闭。 Improve this q
我已成功创建gitolite-admin.git服务器上的存储库(例如)10.107.105.13 。我可以在本地计算机上克隆此存储库(例如)10.14.42.7通过发布 git clone gito
我想使用本地帐户在我的 gitolite 服务器上创建一个新存储库,而不通过 SSH 访问。这可能吗?它们是我可以使用的一些 gitolite 脚本吗? 如果我尝试通过系统上的 git 用户通过查看
我正在尝试使用 Gitolite 在 Gitlab 中创建一个新分支。我完成安装步骤。当我遇到“设置 gitolite”部分时,我遇到了麻烦。我关注了这个link . 当我运行
我正在尝试在我的 ubuntu 服务器机器上安装 gitolite。 尽管如此,还有很多事情我还不知道,但我按照它的指示非常缓慢地前进(http://sitaramc.github.com/gitol
我在 Ubuntu 12.04 上安装了 Gitolite 3.5.3。我创建了测试存储库,我只能通过 gitolite 用户而不是其他用户通过 ssh 访问它。 我需要允许通过 ssh 访问其他系统
这可能吗?我的 authorized_keys 文件被删除,更新 gitolite 管理规则仅附加到文件。是否可以根据 gitolite 配置重新生成整个文件? 编辑:找到了! gitolite 触发
快速说明:在有人指出之前,我最初是在 Server Fault 上发布这个的,但在发布之后我意识到这个站点可能更合适。抱歉“双重发帖”。 大约 6 个月前我安装了 gitolite,突然间我开始收到这
我正在尝试在 redhat 虚拟机上安装 gitolite。现在,机器未连接到互联网。因此,我无法运行标准安装的“克隆”步骤。我的机器上确实有源代码,当我运行“install -ln”步骤时 - 它会
完整的错误信息是: could not symlink /var/lib/gitolite/.gitolite/hooks/common/gitolite-hooked to subdir/myrep
我正处于让 Git 和 Gitolite 工作的最后阶段。这是目前的情况: 最佳答案 Gitolite 管理下的存储库没有工作副本。所以你要做的是创建另一个带有工作副本的存储库,提交数据并将它们推送到
我有一个奇怪的问题。我使用 TortoiseGIT (Win7) 并且我的存储库放置在虚拟服务器 (Debian) 上,我使用 gitolite 和 SSH key 。 我可以 clone存储库到我的
我是第一次设置 gitolite。我正在关注 this instructions . 当我 ssh 时,它看起来很好: $ ssh -p 2222 gitolite@debian PTY alloca
我已经配置了一个存储库和一组用户。 我已将该存储库的读取权限授予该组。 但是当我以不在组中的用户身份登录时,我能够读取存储库。 它在 gitweb 中列出了该存储库。为什么会这样? @all =
每当我尝试在我的笔记本电脑上克隆任何存储库时,我都会收到此消息: Unable to open connection: Host does not existfatal: Could not read
我已经在 ubuntu 服务器上设置了一个 gitolite 存储库,目的是让开发人员克隆/推送我们将要处理的项目。我在 repo 中的接收后 Hook 有问题。我在一个特定的 repo 中有一个接收
我尝试在 this manual 之后安装 git + gitolite - 使用来自服务器的根安装。我只是不明白新的 gitolite 用户是否必须拥有他们的用户帐户?。当我将 tester.pub
我对 gitolite 有点困惑权限。 仅允许 1 个分支并拒绝特定用户或组的所有其他分支的最佳方法是什么? 最佳答案 参见“partial-copy: selective read control
如何配置 git 和 gitolite 以允许特定用户仅更改特定目录内的文件? 例如原始主分支中的文件: /dir1/ /dir2/file1 /dir2/file2 /dir3/file1 用户 k
我正在尝试在我的服务器(Macos 服务器)上设置 gitolite。 我按照此处找到的安装文档中的说明进行操作: http://sitaramc.github.com/gitolite/doc/1-
我是一名优秀的程序员,十分优秀!