Created
May 30, 2019 18:32
-
-
Save sheriffderek/c98fc9e8703251409954e7ac6e871c2d to your computer and use it in GitHub Desktop.
WordPress .gitignore to allow only theme and plugins in repo
This file contains hidden or 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
# Blacklist files/folders in same directory as the .gitignore file | |
/* | |
# Whitelist some files | |
!.gitignore | |
!README.md | |
# Ignore all files named .DS_Store or ending with .log | |
**/.DS_Store | |
**.log | |
# Whitelist folders | |
# yes to folder -> no to contents & repeat... kinda ugly - but gets the job done | |
# !/folder-name - allow-this-folder | |
# /folder-name/* - disallow everything in it | |
!/wp-content | |
/wp-content/* | |
# Up to you... but saves a lot of hassle | |
!/wp-content/plugins | |
# For shared resources mysite.com/resources/video/how-to.mp4 etc. | |
!/resources | |
# Add your theme name below (I like to use `company-name-2019` or something) | |
!/wp-content/themes | |
/wp-content/themes/* | |
!/wp-content/themes/your-theme-name-here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'll need to rename the file
.gitignore
and put it in the root of your project folder / with the.git
folder.( note: command+shift+period to see hidden files in the finder (mac) )