-
-
Save d8m18n/6cb68824330db9bb1fa73b1855820595 to your computer and use it in GitHub Desktop.
WordPress .gitignore - this is my preferred gitignore file when working with WordPress. It ignores almost all files by default.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------- | |
# .gitignore for WordPress @webfoundations (originally forked from @salcode | |
# ver 2017-01-21 | |
# | |
# From the root of your project run | |
# curl -O curl -O https://gist.githubusercontent.com/d8m18n/6cb68824330db9bb1fa73b1855820595/raw/.gitignore | |
# to download this file | |
# | |
# 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 | |
# | |
# Change Log: | |
# 2017-01-21 Created as fork of https://gist.github.com/salcode/b515f520d3f8207ecd04, | |
# 2017-01-21 Added .brackets.json for ignored editor configs | |
# 2017-01-21 Added wp-cli.local.yml to whitelist for @themejuice config | |
# this version ignores all files by default | |
# ----------------------------------------------------------------- | |
# 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 | |
*.sublime-project | |
*.sublime-workspace | |
*.komodoproject | |
.brackets.json | |
# ignore log files and databases | |
*.log | |
*.sql | |
*.sqlite | |
# 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 | |
!README.md | |
!CHANGELOG.md | |
!composer.json | |
!wp-cli.local.yml | |
# 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, plugins, and themes | |
# add your own entries here | |
!wp-content/mu-plugins/example-mu-plugin/ | |
!wp-content/plugins/example-plugin/ | |
!wp-content/themes/example-theme/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment