gpt4 book ai didi

git - 在 git 上设置 umask 权限新分支

转载 作者:行者123 更新时间:2023-12-04 19:31:18 25 4
gpt4 key购买 nike

我已经在 CentOS 8 上配置了一个新的 git 服务器。此外,我已经安装了 gitlist 以使用 Apache 列出 Web 存储库。

我的问题是当我创建一个新分支时,权限设置为 rw-------- 所以 Apache 的用户无法浏览该新分支。我一直在寻找 umask 配置,但没有找到任何东西。

我试过使用 ~/.bashrc,/etc/profile.d/git_umask.sh 没有结果。

有没有办法在 git 服务器上为创建的任何新分支配置 umask?

最佳答案

首先尝试使用以下命令启动本地 Git 存储库:

git init --shared=group 

那会比 umask 更可靠。 .

git init --shared :

Specify that the Git repository is to be shared amongst several users.
This allows users belonging to the same group to push into that repository.

When specified, the config variable "core.sharedRepository" is set so that files and directories under $GIT_DIR are created with the requested permissions.
When not specified, Git will use permissions reported by umask.

关于git - 在 git 上设置 umask 权限新分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61390505/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com