Drupal Development and Consultation - Proudly operating in The United States of America

Drupal 8 Config and Git

By Xandermar LLC, February 20, 2020

CAUSE:

The ‘config’ directory by default in Drupal 8 is under the /sites/< site dir >/files/ path. Unfortunately, the “files” directory is excluded from Git in your webroot’s “.gitignore” file – this includes your recursive directories (like the “config” directory).

SOLUTION:

Simply place the “config” directory in your “/sites/” directory, which is one level higher than the “files” directory. Be sure to also change the Drupal 8 “config” path in the settings.php file.

Once the above steps are complete, run Drush Config Export ($: drush cex) again and then check your Git status (i.e. $: git status). You will notice that Git is now tracking your config changes in your repository.

Have a better method than this? Please let me know in the comments below. Thanks!!

New Articles Alert

Associated Tags

This content is the only content that uses this tag. More coming soon!

Comments