I would like to ignore all files with extensions *.mtx or *.otc in a certain folder (data/) and all files with extension *.pyc in all subfolders. Will this .gitignore should work?
/data/*.mtx
/data/*.otc
*.pyc
Is there a way to make it more compact? Apparently this doesn't work:
/data/(*.mtx|*.otc)
*.pyc
I'd rather not use local gitignore unless strictly necessary, because it seems to me tidier to have all "ignore" instructions in one place, but I'm open to suggestions here
You can keep only one .gitginore at the root folder of your repo.
**/data/*.mtx
**/data/*.otc
*.pyc
That would ignore mtx or otc files in data folders, even if data is not a top-level folder (because you are not using the anchor '/').
Check if this is working with:
git check-ignore -v path/to/a/file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With