With Copilot
Acquia Copilot is a conversational AI connected into our product documentation and knowledge base. Ask Copilot about product features, technical details, troubleshooting and how to get started with Acquia products.
Sign in to use Acquia Copilot
Drupal’s default .gitignore file contains only a few basic pieces of information, and is usually located in your website’s docroot directory. Websites hosted on Cloud Platform can make significant changes to this file, and by changing the .gitignore file, you can prevent your repository from bloat, by preventing storage of images or other large data items.
.gitignore file differences, by Drupal versionThe contents of your website’s .gitignore file depend on the version of Drupal you have installed.
You can modify the .gitignore file of your application running the current Drupal version to ignore the settings.php file. This allows you to update the standard settings.php file with the Drupal local settings file checker:
/**
* Load local development override configuration, if existent.
*
* Use settings.local.php to override variables on secondary (staging,
* development, etc) installations of this site. Typically used to disable
* caching, JavaScript/CSS compression, re-routing of outgoing e-mails, and
* other things that should not happen on development and testing sites.
*
* Keep this code block at the end of this file to take full effect.
*/
if (file_exists(DRUPAL_ROOT . '/' . $conf_path . '/settings.local.php')) {
include DRUPAL_ROOT . '/' . $conf_path . '/settings.local.php';
}The Drupal 7 default .gitignore file on Cloud Platform appears similar to the following:
# Ignore paths that contain user-generated content.
sites/*/files
sites/*/privateDrupal 7’s default file includes a line to ignore any settings*.php files in the docroot directory. Since many websites commit their settings files to Git as part of their workflow, this addition was problematic and is not present in the current Drupal version.
As an example, if you don’t want to commit the default text files to Git, add the following lines to your .gitignore file:
# Ignore default text files
/CHANGELOG.txt
/COPYRIGHT.txt
/INSTALL*.txt
/LICENSE.txt
/MAINTAINERS.txt
/UPGRADE.txt
/README.txt
sites/all/README.txt
sites/all/modules/README.txt
sites/all/themes/README.txtYou can also add additional paths that contain user-generated content, including the same paths that are part of the default file. This can include image files, documents, or other items that should not be placed in the repository.
# Ignore paths that contain user-generated content.
cache/
files/
sites/*/files
sites/*/private
sites/*/files-privateFurther additions can make sense in the Cloud Platform environment, but you should consider each change carefully to ensure that any changed files that are part of your codebase get backed up.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.