i use an allow list pattern on my gitignores, this way only stuff i mean to be in there is caught, everything else gets ignored
Discussion
https://github.com/mleku/realy/blob/dev/.gitignore
been using this since i had a colleague include a node_modules in our fiat mine project a year ago
this list will pretty much keep anything useful, just don't use .txt for secret files lol