Why is git clone changing file permissions

前端 未结 1 1858
梦如初夏
梦如初夏 2021-02-11 00:38

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

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

1条回答
  •  误落风尘
    2021-02-11 01:07

    Check your config on the server where you are cloning:

    git config core.sharedRepository
    
    • 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.

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

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

    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.

    0 讨论(0)
提交回复
热议问题