Skip to content

Instantly share code, notes, and snippets.

@cabrerahector
Created December 30, 2025 16:36
Show Gist options
  • Select an option

  • Save cabrerahector/7a6f2a8030709ba6d005b06718733b4f to your computer and use it in GitHub Desktop.

Select an option

Save cabrerahector/7a6f2a8030709ba6d005b06718733b4f to your computer and use it in GitHub Desktop.
Example .gitignore file for WordPress Development
# Ignore everything in the root directory except the "wp-content" directory
# and this .gitignore file.
/*
!wp-content/
!.gitignore
!readme.md
# Ignore everything in the "wp-content" directory, except:
# "mu-plugins" and "themes" directory
wp-content/*
!wp-content/mu-plugins/
!wp-content/themes/
# Ignore all mu-plugins and themes
# unless explicitly whitelisted at the end of this file
wp-content/mu-plugins/*
wp-content/themes/*
# Ignore node/grunt dependency directories
node_modules/
# Ignore bower dependency directories
bower_components/
# Ignore log files and databases
*.log
*.sql
*.sqlite
# Ignore packages
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Ignore OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
desktop.ini
# Ignore editor generated files
*.sublime-project
*.sublime-workspace
*.komodoproject
.classpath
.project
.settings
.idea
.metadata
*.iml
*.ipr
*.un~
# Track these project-specific files/folders
!favicon.ico
!wp-content/maintenance.php
# Track these mu-plugins and themes
!wp-content/mu-plugins/cabrerahector-dot-com.php
!wp-content/themes/chassis/
!wp-content/themes/chassis-2021/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment