I am using git version 2.17.1
.
I would like to ignore wp-content/uploads/*
and !wp-content/uploads/mailster/templates/sartre
to my git repository.
I used the last 3 lines in the script to accomplish this.
However, the files do not get added to my repository.
Find below my *.gitignore
file:
*.log
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
wp-content/upgrade/
wp-content/wp-cache-config.php
wp-content/plugins/hello.php
/.htaccess
/license.txt
/readme.html
/sitemap.xml
/sitemap.xml.gz
# Do not Ignore
package.json
acf-export-2019-11-15.json
# Ignore everything in the "wp-content" directory, except the "plugins",
# "themes" and "mu-plugins" directories.
wp-content/*
!wp-content/plugins/
!wp-content/mu-plugins/
!wp-content/themes/
!wp-content/uploads/
# Ignore everything in the root except the "wp-content" directory.
/*
!.gitignore
!wp-content/
# Ignore everything in the "plugins" directory, except the plugins you
# specify (see the commented-out examples for hints on how to do this.)
wp-content/plugins/*
!wp-content/mu-plugins
!wp-content/plugins/calendar
wp-content/plugins/calendar/vendor
wp-content/plugins/calendar/vendor/
# Ignore everything in the "themes" directory, except the themes you
# specify (see the commented-out example for a hint on how to do this.)
wp-content/themes/*
/wp-content/themes/twentynineteen/vendor/
!wp-content/themes/twentynineteen
# Ignore everything in the "uploads" directory, except the uploads you use
wp-content/uploads/*
!wp-content/uploads/mailster/templates/sartre
I appreciate your replies!