I'm working on a Drupal 8 project, and installed Drupal console globally on my system.

The command drupal init created a console folder at the root of Drupal.

It seems to be used as a cache directory. Well it's a guess from what I see inside it.

Can I safely add this directory to my .gitignore file? Or should I commit it?

  • It depends on your need, if you don't want to track the changes in those files. Put it in gitignore else comit it – Fazeela Abu Zohra Feb 16 '17 at 10:06
  • Thanks for your comment, but that doesn't really help me. The question is not do I need that directory or not. But does Drupal need it? In a deployment context. – jchatard Feb 16 '17 at 11:08

Yes, you can add the console directory to your .gitignore like so:


However, similar to drush, you may want to carry around project-specific configurations in your repository. This allows changing the behavior of Drupal Console on a per-repository basis.

If you do want to have per-repository Drupal Console configurations then do not gitignore the console directory and instead commit it to the project.

See https://hechoendrupal.gitbooks.io/drupal-console/en/commands/init.html for details on how to initialize configurations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.