is there a non destructive way (no commit, no changes to the repo) to let .gitignore file itself be really ignored in git version 2.34.1 or later?
I've been trying many answers from How can I stop .gitignore from appearing in the list of untracked files? and others.., least the destructive ones that want to change the repository to let it work.
Also, I do not want to use any trick in the global git ignore file, as it is global and I need specific config for a single project.
I am careful, I dont need an app to ex.: force me to not ignore .gitignore for any good reason.
The problem is, I would have to create backup copies of .gitignore outside project folder and revert it before a merge, and restore after that, and doing it is very annoying.
I am coding in a forked repo. I dont want to change that file in my repo as it will be extra trouble to prepare pull requests...
I tried patching git executable and git-gui shell script with ex sed -i -r 's@gitignore@git1gn0r3@' git, but it didnt help. Is the only option to make a non system installation and patch the whole git app to let this simple thing work?
suggestion: if we had a git param like:
git --I-Surely-Know-What-I-Am-Doing, it could create a big message on startup saying I should not complaint if something wrong happens and I would be fine with it...
so I have tried putting in .gitignore .gitignore and nothing changed. I also tried placing it at .git/info/exclude and nothing happened.
any tip?

.gitignorecan definitely be ignored, but it is not possible in Git to ignore changes to tracked files, so.gitignorecannot be ignored and tracked at the same time. Some people recommend various features ofgit update-indexto try to do that, but the Git FAQ is very clear that doesn't work properly and shouldn't be used.If you have a
.gitignorefile that isn't checked in, then you can ignore it by adding.gitignorein.git/info/exclude. However, you'd be better off simply using.git/info/excludeto customize the patterns instead. That's specifically designed to allow you to customize the values and override what's in the repository. The patterns in this file take precedence over.gitignore, so you can add exclusions (starting with!) or regular ignore patterns to customize them as you see fit.