I’m trying to get a .gitignore working in wordpress. I want to exclude the uploads files and the temporary plugin upgrade files, but not ignore the .htaccess and index.html static files in those directories (or any other sub directories).
I tried:
# Uploads
/wp-content/uploads/*
# temp backup
/wp-content/upgrade-temp-backup/
# include any htaccess files or static indexes
!**/.htaccess
!**/index.html`
but it is still saying the .htaccess and index files under wp-content are ignored when I try to ‘add’ them to git.
Can anyone help me out with whatever I’m missing here?
I also tried exclusions directly to the files effected and got the same result. e.g.
!/wp-content/uploads/woocommerce_uploads/.htaccess
!/wp-content/uploads/woocommerce_uploads/index.html
!/wp-content/uploads/wc-logs/.htaccess
!/wp-content/uploads/wc-logs/index.html`
Scott Wood is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.