Question

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 they are supposed to be 644.

What's going on?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top