How do I ignore all files in a project except two subdirectories? I don\'t want to include all of Wordpress in Git, but I do want to include the customized themes. I have tw
Ok I found a way, but this is completely ridiculous! This way will list untracked files if a new file is added.
# Ignore everything in src/ except wp-content/
src/*
!src/wp-content/
# Ignore everything in wp-content/ except themes/
src/wp-content/*
!src/wp-content/themes/
# Ignore everything in themes/ except for these 2 themes
src/wp-content/themes/*
!src/wp-content/themes/chocolat-child/
!src/wp-content/themes/othertheme