为什么git克隆更改文件权限 [英] Why is git clone changing file permissions

查看:90
本文介绍了为什么git克隆更改文件权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Why does the file permissions for all my WordPress files are being changed when I clone?

当它们应该是755时,目录是775,文件是664当它们应该是644时。

The directories are 775 when they are supposed to be 755 and files are 664 when they are supposed to be 644.

发生了什么事?

What's going on?

推荐答案

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

Check your config on the server where you are cloning:

git config core.sharedRepository




  • 如果它设置为 group ,它会自动设置可写位。

  • 如果设置为 umask ,则取决于您的本地umask。 b $ b

    • If it is set to group, it would set the writable bit automatically.
    • If it is set to umask, it would depends on your local umask.
    • 更一般地,检查 umask (如在这个问题中)。

      More generally, check your umask (as in this question).

      OP Kenny 确认设置 umask 至 0022 的作品。

      此答案中引用的文章详细说明了它在安全性方面的含义。

      The OP Kenny confirms that setting umask to 0022 works.
      The articles referenced in this answer detail what it involves in term of security.


      用于普通用户的默认 umask 002

      A umask 022 只允许您写入数据,但任何人都可以读取数据。

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

      这篇关于为什么git克隆更改文件权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆