Why are themes in repository not ignored, too?

The WordPress Bedrock .gitignore doesn’t include the web/app/themes directory.

What is the reason for this? I made the particular (sage based) theme directory a separate git repository with separate development (a (good) theme can be used on other WordPress installations, too).
Also, multiple themes could be developed for a single WordPress Bedrock installation or legacy themes kept, etc.

Because if you want to ignore it, you can.

Most people develop their theme locally, commit to git, and then push. You’re just being special.

Thanks for your answer.

Are there best practices for folders with PHP app that don’t directly belong to WordPress but to the site itself, that reside in site/web/?

I noticed the folder site/web/app/languages is not ignored by git either.
Most of the languages files were installed with their respective plugins.
Also mu-plugins and similar auxiliary files which are installed by composer instead are not ignored.

Theme build folder (dist) is ignored on the other hand, these are synced without git during deploy (capistrano style) - why not the same with /web/app/languages and /web/app/mu-plugins?

mu-plugins are ignored if they’re installed via Composer (ie: sub folders).

Basically anything managed by Composer is Git ignored. Anything that isn’t, is not. You’re free to change any of those defaults though.

Thanks, I just found the line ‘web/app/mu-plugins/*/’, it excludes the folders but not files directly in folder, this is intentional probably.

It’s intentional. We use wpackagist to manage plugins, but it can only install plugins in subdirectories. This was a problem for mu-plugins as they aren’t loaded from subdirectories by WordPress core. We created the Bedrock autoloader plugin to bridge this gap.

The languages folder isn’t part of a core install when using US English, but I would agree with you that its contents should be gitignored.

1 Like

Shouldn’t this be added then to WordPress Bedrock .gitignore - or are there side effects or use cases where it makes sense to commit the language files?

I just noticed that the site also has a plugin that contains very site-specific functionality, I think I should also add it to the bedrock repository instead treating it as a separate plugin because there would be no real use of it outside this site.

Related to ignoring language files: