From 4d9d3fff4a54f0a4b68523984f40626f0f9bc89c Mon Sep 17 00:00:00 2001 From: Pedro Machado Santa Date: Wed, 22 Jan 2020 01:51:50 +0000 Subject: [PATCH 1/3] Update and fix WordPress gitignore --- WordPress.gitignore | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/WordPress.gitignore b/WordPress.gitignore index a32768a9..be4d27d1 100644 --- a/WordPress.gitignore +++ b/WordPress.gitignore @@ -1,23 +1,29 @@ -# ignore everything in the root except the "wp-content" directory. -!wp-content/ +# Wordpress - ignore core, configuration, examples, uploads and logs. +# https://github.com/github/gitignore/blob/master/WordPress.gitignore -# ignore everything in the "wp-content" directory, except: -# "mu-plugins", "plugins", "themes" directory -wp-content/* -!wp-content/mu-plugins/ -!wp-content/plugins/ -!wp-content/themes/ +# Core and configuration +/wp-admin/ +/wp-content/index.php +/wp-content/plugins/index.php +/wp-content/themes/index.php +/wp-includes/ +/index.php +/license.txt +/readme.html +/wp-*.php +/xmlrpc.php -# ignore these plugins -wp-content/plugins/hello.php +# Example themes +/wp-content/themes/twenty*/ -# ignore specific themes -wp-content/themes/twenty*/ +# Example plugin +/wp-content/plugins/hello.php -# ignore node dependency directories -node_modules/ +# Uploads +/wp-content/uploads/ -# ignore log files and databases +# Log files *.log -*.sql -*.sqlite + +# htaccess +/.htaccess \ No newline at end of file From 3514a03514b3607d1c09759babb1d004367c032e Mon Sep 17 00:00:00 2001 From: Pedro Machado Santa Date: Thu, 23 Jan 2020 18:27:27 +0000 Subject: [PATCH 2/3] Update gitignore with note/option for wp core commit --- WordPress.gitignore | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/WordPress.gitignore b/WordPress.gitignore index be4d27d1..4fceea09 100644 --- a/WordPress.gitignore +++ b/WordPress.gitignore @@ -1,7 +1,10 @@ # Wordpress - ignore core, configuration, examples, uploads and logs. # https://github.com/github/gitignore/blob/master/WordPress.gitignore -# Core and configuration +# Core +# +# Note: if you want to stage/commit WP core files +# you can delete this whole section/until Configuration. /wp-admin/ /wp-content/index.php /wp-content/plugins/index.php @@ -13,6 +16,9 @@ /wp-*.php /xmlrpc.php +# Configuration +wp-config.php + # Example themes /wp-content/themes/twenty*/ From cd92ee374aac7d1697d3eac31ae13793cdeaf44e Mon Sep 17 00:00:00 2001 From: Pedro Machado Santa Date: Thu, 23 Jan 2020 20:16:15 +0000 Subject: [PATCH 3/3] Add languages folder and add commented lines for a whitelist approach --- WordPress.gitignore | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/WordPress.gitignore b/WordPress.gitignore index 4fceea09..ba95e278 100644 --- a/WordPress.gitignore +++ b/WordPress.gitignore @@ -7,6 +7,7 @@ # you can delete this whole section/until Configuration. /wp-admin/ /wp-content/index.php +/wp-content/languages /wp-content/plugins/index.php /wp-content/themes/index.php /wp-includes/ @@ -32,4 +33,16 @@ wp-config.php *.log # htaccess -/.htaccess \ No newline at end of file +/.htaccess + +# All plugins +# +# Note: If you wish to whitelist plugins, +# uncomment the next line +#/wp-content/plugins + +# All themes +# +# Note: If you wish to whitelist themes, +# uncomment the next line +#/wp-content/themes \ No newline at end of file