可以 git 存储或控制目录用户、组或权限

Can git store or control directory user, group or permissions

我已经为 Web 应用程序开发了几个 git 存储库。作为部署过程的一部分,一些文件夹需要 Apache 可写才能上传文件。 git 是否对用户或组或相应的权限有任何控制?

git 只能对整个仓库设置,不能对子目录设置。 运行 在你的 repo 的根目录中:

sudo chgrp -R apache .
sudo chmod -R ug+rwX *
git config core.sharedRepository group