I am trying to setup gitignore to exclude all subdirectories except for 2. I have included ~!~ for the two i want to include but Sourcetree does not pick it up.
Here is my relevant gitignore
# .gitignore
node_modules/
wp-content/plugins/
wp-content/upgrade/
!wp-content/plugins/export-tool
!wp-content/plugins/darwin_checkout_tracking
The two files were set to be included just not. Before they were excluded.
The /* is important, you must do:
# .gitignore
node_modules/
wp-content/plugins/*
wp-content/upgrade/*
!wp-content/plugins/export-tool
!wp-content/plugins/darwin_checkout_tracking
And it works