Skip to content

Instantly share code, notes, and snippets.

@lukecav
Last active June 2, 2023 03:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lukecav/bc2a0c368ca55185cbcf5d5687d717b4 to your computer and use it in GitHub Desktop.
Save lukecav/bc2a0c368ca55185cbcf5d5687d717b4 to your computer and use it in GitHub Desktop.
WordPress - GitHub Repo .gitignore example
# -----------------------------------------------------------------
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
#
# To ignore uncommitted changes in a file that is already tracked, use
# git update-index --assume-unchanged
#
# To stop tracking a file that is currently tracked, use
# git rm --cached
#
# -----------------------------------------------------------------
# ignore everything in the "wp-content" directory, except:
# mu-plugins, plugins, and themes directories
/*
!mu-plugins/
!plugins/
!themes/
# ignore all mu-plugins, plugins, and themes
# unless explicitly whitelisted at the end of this file
mu-plugins/*
plugins/*
themes/*
# ignore OS generated files
# OS generated files #
######################
*/.DS_Store
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
*~
.svn
.cvs
*.bak
*.swp
.sass-cache
debug.log
.idea
node_modules
.htaccess
.env
.env.php
# ignore log files and databases
*.log
*.sql
*.sqlite
# ignore packaged files
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.swp
*.swo
*.tar
*.zip
# Ignore Composer Vendor files
mu-plugins/app/vendor/*
# Wordpress Specific
uploads/
blogs.dir/
upgrade/*
backup-db/*
wp-cache-config.php
wp-config.php
wp-config-sample.php
wpvividbackups/*
cache/*
cache/supercache/*
cache/all/*
uploads/backupbuddy_backups/*
db.php
# Ignore advanced-cache and object-cache for now
advanced-cache.php
object-cache.php
# Ignore mu-plugins, themes and plugins by default
mu-plugins/*
themes/*
plugins/*
!mu-plugins/index.php
# !themes/index.php
# !plugins/index.php
# ----------------------------
# Custom Plugin / Theme Files
# ----------------------------
# WordPress SEO Ignores
/plugins/wordpress-seo-premium/vendor/yoast/api-libs/google/cache/
# Beaver Builder Ignores
/uploads/bb-plugin/cache/
# WP Rocket Ignores
/advanced-cache.php
# Autooptimize
/cache/autoptimize/
# -------------------------
# BEGIN Whitelisted Files
# -------------------------
# track these misc files
!/icons/
# track these files, if they exist
!/.gitignore
!.gitignore
!.editorconfig
!.babelrc
!.eslintrc
!README.md
!CHANGELOG.md
!composer.json
!composer.lock
!/index.php
# track favicon files, if they exist
!android-chrome-*.png
!apple-touch-icon*.png
!browserconfig.xml
!favicon*.png
!favicon*.ico
!manifest.json
!mstile-*.png
!safari-pinned-tab.svg
# track these mu-plugins
!mu-plugins/custom-plugin/
!mu-plugins/custom-plugin.php
# Allow mu-plugins
!mu-plugins/bb-custom-modules/
# track these plugins
!plugins/custom-blocks/
!plugins/custom-plugin/
!plugins/advanced-gutenberg/
# track these themes
!themes/custom-theme/
@lukecav
Copy link
Author

lukecav commented Sep 23, 2021

Update themes and plugins to be tracked as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment