Skip to content

Instantly share code, notes, and snippets.

@yratof
Last active August 12, 2021 08:07
Show Gist options
  • Save yratof/dabcb9220c5881aabd480dc3e5c31920 to your computer and use it in GitHub Desktop.
Save yratof/dabcb9220c5881aabd480dc3e5c31920 to your computer and use it in GitHub Desktop.
Correct .git permissions for wordpress based systems
chown -R `whoami` * # Let Apache be owner
find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r--
# For servers
chown -R www-data:www-data .
find . -type d -exec chmod 570 {} \; # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 460 {} \; # Change file permissions rw-r--r--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment