Keep your git repositories clean with this minimal WordPress gitignore

Six months ago I started using the below, slightly modified, WordPress git ignore file from  in all my WordPress projects and I’ve never looked back since.

The main focus of this WordPress git ignore is to push the wp-content folder only and ignore everything else in the root.

I made a handful of additions

I’ve added in a ‘do not ignore’ for a couple of things in the wp-content folder, though I appreciate these are for specific use cases and not required additions for everyone:

Let me know what you think in the comments below and please share your thoughts and your own variations of git ignore for WordPress.


Leave a Reply