On this page
Setting proper file permissions before committing files
The Drupal project aims for consistency and correct values by default. The final permissions suggested for files are covered at great length in the security handbook. For files checked into the git repository on drupal.org, the standard is set forth by core of what permissions are appropriate.
- Most files should be 644 or
-rw-r--r-- - All directories should be 755 or
drwxr-xr-x - Files that are intended to be run at the command line should have the executable bit set meaning 755 or
-rwxr-xr-x
Another resource about the proper permissions is Drupal.StackExchange: What are the recommended directory permissions?. Files committed to the repository on drupal.org should use permissions that match the ideal case as closely as possible.
Commands
On Linux/Unix/Mac command line, use the chmod command to change file permissions.
On Windows, even with a Linux-like command window, changing file permissions will not work. As a work-around, you can use Git commands like this:
# Example: Remove the executable bit:
git update-index --chmod=-x path/to/file.extHelp improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.