← All Articles A Product of Kinsa Creative

.gitignore file for WordPress Theme Development

A .gitignore file for WordPress Theme Development to place in the top level directory. Utilizes exclusion pattern matching to keep the WordPress core and node_modules/ out of the Git repository while tracking the theme and plugin files.

# Ignore everything
*
# But descend into directories
!*/

# # Recursively allow files under:
# "mu-plugins", "plugins", "themes" directory
!/wp-content/mu-plugins/**
!/wp-content/plugins/**
!/wp-content/themes/**

# ignore this file
wp-content/themes/index.php

# ignore specific themes
wp-content/themes/twenty*/

# ignore node dependency directories
node_modules/

# ignore log files and databases
*.log
*.sql
*.sqlite
*.DS_Store

# don't ignore this file
!.gitignore

Feedback?

Email us at enquiries@kinsa.cc.