gpt4 book ai didi

git - 为什么git clone改变文件权限

转载 作者:太空狗 更新时间:2023-10-29 13:53:23 25 4
gpt4 key购买 nike

为什么我克隆时所有 WordPress 文件的文件权限都被更改了?

目录本应为 755 时为 775,文件本应为 644 时为 664。

这是怎么回事?

最佳答案

检查您正在克隆的服务器上的配置:

git config core.sharedRepository
  • 如果设置为group,它会自动设置可写位。
  • 如果设置为umask,则取决于您本地的umask。

更一般地说,检查您的 umask(如 in this question )。

OP Kenny confirms该设置 umask to 0022有效。
this answer中引用的文章详细说明它涉及的安全性。

The default umask 002 used for normal user. With this mask default directory permissions are 775 and default file permissions are 664.

A umask of 022 allows only you to write data, but anyone can read data.

关于git - 为什么git clone改变文件权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23667859/

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