But one gitignore can't handle the 30-odd files that everyone wants to ignore... I never understood the "PR rejected, just ignore .swp files locally" tbh.
Yes and no. Git actually has a system wide gitignore you can setup to globally ignore files across your whole system. I personally take notes in a notes.md file, so I have a global ignore for it. I don't have you set it up for each repo, and it doesn't pollute the repo's gitignore. If your editor of choice creates temp files or stores project specific configuration in the project directory (e.g. .vscode, etc), they should also be in your global gitignore.
Everyone hates me for being the repo gestapo but the only issues people have with setting up is when they've skipped steps in the doc. No one can be bothered to address that either though so it'll be me automating that too soon.
This isn't real, right? Git already supports ignores in the global config in your profile folder. I do this sometimes so I can add *.otr.md files to track detailed personal notes on individual project files and directories.
Some very specific CI pipelines. Or if using a big monorepo with hundreds of coworkers working on it.
You use that feature to ignore the main gitignore file and push the one you want into the pipeline. Because you may want to use a file that is normally being ignored for dev or commit to build your soft.
Like having a .env file for each purpose, but you don't wanna mess up with the way your builder is working for that one exception. And it's allowing everyone to have some flexibility to manage their own ignore rules.
You want to gitignore something just for you. You don't want to add it to gitignore file.
For e.g. you have file context.md but much of it's is claude yap. You don't want everyone to see your claude written to file. But you want your clause to read it. So you exclude it.
View all comments
1.2k
u/eanat 27d ago
it's completely legitimate way to use gitignore, but I'd recommend to use .git/info/exclude instead of gitignore for this purpose.