Skip to content

Instantly share code, notes, and snippets.

@MikeGillihan
Last active February 8, 2022 00:00
Show Gist options
  • Save MikeGillihan/9bd7610afd4b594d31ee12b81ac88687 to your computer and use it in GitHub Desktop.
Save MikeGillihan/9bd7610afd4b594d31ee12b81ac88687 to your computer and use it in GitHub Desktop.
# -----------------------------------------------------------------
# .gitignore for WordPress
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/MikeGillihan/9bd7610afd4b594d31ee12b81ac88687/raw/.gitignore
# to download this file
#
# By default all files are ignored. You must 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
#
# Change Log:
# 20220207 Update to CauseLabs defaults
# 20220207 Created as fork of https://gist.github.com/salcode/b515f520d3f8207ecd04,
# this version ignores all files by default. Credit: @salcode
# -----------------------------------------------------------------
# ignore everything in the root except the "wp-content" directory.
/*
!wp-content/
# ignore everything in the "wp-content" directory, except:
# mu-plugins, plugins, and themes directories
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/
# ignore all mu-plugins, plugins, and themes
# unless explicitly whitelisted at the end of this file
wp-content/mu-plugins/*
wp-content/plugins/*
wp-content/themes/*
# ignore all files starting with . or ~
.*
~*
# ignore node dependency directories (used by grunt)
node_modules/
# ignore OS generated files
ehthumbs.db
Thumbs.db
# ignore Editor files
*.esproj
*.komodoproject
*.sublime-project
*.sublime-workspace
*.tmproj
*.tmproject
.*.sw[a-z]
*.swp
*.un~
Session.vim
tmtags
# ignore log files and databases
*.log
*.sql
*.sqlite
log.txt
# ignore compiled files
*.com
*.class
*.dll
*.exe
*.o
*.so
# ignore packaged files
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# -------------------------
# BEGIN Whitelisted Files
# -------------------------
# track these files, if they exist
!.gitignore
!.editorconfig
!.phpcs.xml.dist
!README.md
!CHANGELOG.md
!composer.json
# 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
!site.webmanifest
# track these mu-plugins, plugins, and themes
# add your own entries here
!wp-content/plugins/cl-core/
!wp-content/plugins/cl-toolkit/
!wp-content/themes/cl-astra-child/
!wp-content/themes/cl-bb-child/
!wp-content/themes/cl-frost-child/
!wp-content/themes/cl-genesis-child/
!wp-content/themes/cl-kadence-child/
!wp-content/themes/cl-pbf-child/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment