In less than 12 months, Drupal 7 will be end-of-life and no longer supported. Plan your upgrade to Drupal 10 now.

.gitignore or .gitallow

Following last week's email on different ways to write .gitignore files, friend of the list, Daniel Harper, sent me this reply (shared with permission):

I had a debate once about this topic and we settled on ignore as the filename explicitly describes what it should be doing ie. It's not .gitallow 😆

This is a good point.

What do people expect to see in a .gitignore file?

A list of directories and files to be ignored or allowed?

Based on the filename, it should be the former.

This would be clearer for people when they first open the file.

However, if you decide to use the allow approach instead, document it in an ADR or design document and why you decided to do it that way and provide context for people working on the codebase in the future.

- Oliver

P.S. Do you need immediate access to an expert Drupal Developer? With my Drupal development subscription, make unlimited requests for a fixed monthly price in less time than posting to a job board!

Was this useful?

Sign up here and get more like this delivered straight to your inbox every day.

About me

Picture of Oliver

I'm an Acquia-certified Drupal Triple Expert with 17 years of experience, an open-source software maintainer and Drupal core contributor, public speaker, live streamer, and host of the Beyond Blocks podcast.