This is a config option you can set in settings.php. If you're annoyed by Drupal periodically removing the write permission, making you add it back in when switching git branches or modifying files in the directory, this setting is for you! This is configured by default in settings.local.php, which I suggest you use (but read through what it does first!).
/** * Skip file system permissions hardening. * * The system module will periodically check the permissions of your site's * site directory to ensure that it is not writable by the website user. For * sites that are managed with a version control system, this can cause problems * when files in that directory such as settings.php are updated, because the * user pulling in the changes won't have permissions to modify files in the * directory. */ $settings['skip_permissions_hardening'] = TRUE;