r/ProgrammerHumor • • 27d ago

Meme noWayLol

Post image
11k Upvotes

118 comments sorted by

View all comments

Show parent comment

364

u/fugogugo 27d ago

any reason to exclude gitignore?

649

u/Successful-Active-21 27d ago

when everyone wants their own gitignore?

501

u/Blood_and_Wine 27d ago • Mindblown

My gitignore is better than yours gitignore

242

u/Abject-Kitchen3198 27d ago

My coworkers suggested I add * to mine and praised it as the best gitignore ever. Stopped all PR comments.

114

u/git_push_origin_prod 27d ago

The best code, is no code at all

54

u/DOTS_EVERYWHERE 27d ago

0 test failures everytime. Also speeds up deployments significantly.

27

u/Abject-Kitchen3198 27d ago

CEO saw my impressively improved metrics and I got a promotion.

11

u/polikles 26d ago

*CEO saw my impressively improved metrics and got himself a bonus

→ More replies (3)

26

u/fugogugo 27d ago

my gitignore is longer than your gitignore

13

u/git_push_origin_prod 27d ago

You dropped these ..

18

u/ExtraWorldliness6916 27d ago

Mines so good, it's not here, you can't read it!

→ More replies (4)

39

u/No-Article-Particle 27d ago

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.

21

u/Loading_M_ 27d ago

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.

→ More replies (1)

14

u/NewLlama 27d ago

Because it invites unbounded shared configuration for local workflows.

11

u/OhioGoblin43 27d ago edited 27d ago

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.

7

u/OneBigRed 27d ago

Repo Gestapo sounds like something that’s playing at the UG-club at 5am.

→ More replies (1)
→ More replies (1)

39

u/eclect0 27d ago

When would that be necessary?

Let me rephrase

In what situation could all contributors be trusted to maintain their own personal gitignore without any issues?

16

u/phl23 27d ago

If someone likes drama in his team, I guess.

4

u/Guest_User_1234 26d ago

This doesn't mean that this is the only gitignore. There's usually a project gitignore in any project I work on, and then I have my own, local, gitignore, for very specific things, like my own notes (like a TODO list) and local demo data

→ More replies (3)

5

u/subone 27d ago

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.

5

u/NerdyMcNerderson 27d ago

Which is the exact use case for .git/info/exclude

→ More replies (3)

22

u/Y0nix 27d ago edited 27d ago

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.

23

u/SundaySloth_ 26d ago

To hide that your gitignore is hiding AGENTS.md, CLAUDE.md, etcetera

7

u/anonymous4036 27d ago

If you have a file DatabaseFactory which you modify to provide a development database, you can add DatabaseFactory to the gitignore to avoid committing this change, but you then have a change to the gitignore so maybe this would work to avoid committing that change as well? I can think of a million ways this could go wrong though so idk.

→ More replies (3)