I have a directory in a git repo that is set to ignore all files except certain patterns like so:
# ignore all files except for template config files
!/
/*
!exception_dir/
!.gitignore
!init.sh
!blah.template.json
I have added a subdirectory that I would like to set exceptions for. Like so:
# ignore all files except for template config files
!/
/*
!exception_dir/
!.gitignore
!init.sh
!blah.template.json
!exception2_subdir/
As expected, the above syntax does not ignore all files within 'exception2_subdir'. However, I only want certain files added to git within exception2_subdir. I found the following syntax via google searches:
# ignore all files except for template config files
!/
/*
!exception_dir/
!.gitignore
!init.sh
!blah.template.json
!exception2_subdir/add_this_template_file_to_git_please
!exception2_subdir/add_this_template_file_to_git_please2
This syntax doesn't seem to be working. When I try to manually add 'exception2_subdir/add_this_template_file_to_git_please', I get the error message that this path is ignored by my .gitignore file. Any tips?
Please note that this is not my architecture so I have limited ability to change the structure.
Thanks!
Eric