Skip to content

Instantly share code, notes, and snippets.

@lumpysimon
Last active April 5, 2022 00:37
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save lumpysimon/10072073 to your computer and use it in GitHub Desktop.
Save lumpysimon/10072073 to your computer and use it in GitHub Desktop.
A .gitignore file for WordPress that ignores pretty much everything except for the specified plugin(s), theme(s) and mu-plugins folder
# .gitignore file for WordPress that ignores everything except:
#
# - .gitignore
# - favicon.ico
# - wp-config.php
# - everything in mu-plugins
# - my-plugin
# - my-theme (except for .sass-cache)
#
# based on https://gist.github.com/jdbartlett/444295
/*
!.gitignore
!favicon.ico
!wp-config.php
!wp-content
wp-content/*
!wp-content/mu-plugins
!wp-content/plugins
!wp-content/themes
wp-content/plugins/*
!wp-content/plugins/my-plugin
wp-content/themes/*
!wp-content/themes/my-theme
.sass-cache
@codywilliamson
Copy link

Just what I was looking for! Thanks.

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