Skip to content

Instantly share code, notes, and snippets.

@esamattis
Forked from salcode/.gitignore
Created September 7, 2016 10:42
Show Gist options
  • Save esamattis/4c34d665d26cd8d8ea83d7d06b423e66 to your computer and use it in GitHub Desktop.
Save esamattis/4c34d665d26cd8d8ea83d7d06b423e66 to your computer and use it in GitHub Desktop.
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
# http://git-scm.com/docs/gitignore
#
# NOTES:
# The purpose of gitignore files is to ensure that certain files not
# tracked by Git remain untracked.
#
# 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:
# 20150227 Ignore hello.php plugin. props @damienfa
# 20150227 Change theme ignore to wildcard twenty*. props @Z33
# 20140606 Add .editorconfig as a tracked file
# 20140404 Ignore database, compiled, and packaged files
# 20140404 Header Information Updated
# 20140402 Initially Published
#
# -----------------------------------------------------------------
# ignore everything in the root except the "wp-content" directory.
/*
!wp-content/
# ignore all files starting with .
.*
# track this file .gitignore (i.e. do NOT ignore it)
!.gitignore
# track .editorconfig file (i.e. do NOT ignore it)
!.editorconfig
# track readme.md in the root (i.e. do NOT ignore it)
!readme.md
# ignore all files that start with ~
~*
# ignore OS generated files
ehthumbs.db
Thumbs.db
# ignore Editor files
*.sublime-project
*.sublime-workspace
*.komodoproject
# 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
# ignore everything in the "wp-content" directory, except:
# "mu-plugins" directory
# "plugins" directory
# "themes" directory
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/
# ignore these plugins from the core
wp-content/plugins/hello.php
wp-content/plugins/akismet/
# ignore specific themes
wp-content/themes/twenty*/
# ignore node/grunt dependency directories
node_modules/
@vividappadmin
Copy link

should you include sitemap.xml files to be ignored?

@AlBlanc
Copy link

AlBlanc commented Mar 20, 2019

Yes you should include sitemap.xml as well

@patterueldev
Copy link

How about wp-config?

@misfist
Copy link

misfist commented May 22, 2019

Also add .DS_Store to # ignore OS generated files?

@samk-dev
Copy link

samk-dev commented Jun 8, 2019

@misfist I think it's added here:

ignore all files starting with .

.*

using this file when I push changes to the repo is not including the .DS_Store files

@Pigeo
Copy link

Pigeo commented Oct 15, 2019

how about .htaccess files ? They shouldn't be ignored.

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