r/programmingmemes • • 6d ago

gitignore

Post image
2.2k Upvotes

31 comments sorted by

63

u/Worried-Priority-122 6d ago

.gitignore

25

u/Teemun_kauppa 6d ago

.gitignore

36

u/pstmps 6d ago

Why are these comments empty? I can't see the meme either

111

u/al2klimov 6d ago

The joke is, it doesn't even work.

78

u/MarsMaterial 6d ago

Makes sense.

It’s like seeing a sign that says “WARNING: DO NOT READ THIS SIGN”. By the time you know what not to do, you’ve already done it.

19

u/Electronic-Ninja7950 5d ago

DO NOT READ THIS COMMENT

7

u/BinaryBolias 5d ago

Okay. Done.

10

u/MeMahi 6d ago

Not really? Surely git the program could read a local file on your PC that says "don't include this in the repository"?

15

u/belabacsijolvan 6d ago

it does work tho.

did you remove it from cached?

13

u/al2klimov 5d ago

Ok, wait. It does work as long as you don't add or commit the file!

1

u/chrisso123 5d ago

I was just wondering if it would work an hour ago... can they read my mind now?

1

u/funny_xor_die 5d ago

I for one am thankful for these mechanisms. The number of times I’ve typed `git add .git` then Enter. Then “oh fuck”.

19

u/Hyphonical 6d ago

Can you .gitignore .git?

10

u/BigGuyWhoKills 5d ago

Yes, but it is ignored by default. I don't know if that's because it is hidden or if it is a special rule.

10

u/rainispossible 5d ago

pretty sure it's the latter. hidden files are still tracked unless explicitly ingnored

8

u/vegan_antitheist 5d ago

That's like putting "google" in to google. It will break the internet!

4

u/Purple-Midnight-9902 5d ago

Time to create some files in your repo

touch add checkout rm commit status log

Git add add, checkout checkout, rm rm, status status

3

u/moramikashi 5d ago

I should try this

3

u/FinalNandBit 5d ago

DS_Store makes an appearance.

1

u/apnorton 2d ago

Aside: please commit your .gitignores. It's much better for repository hygiene if you do so, rather than leaving it up to every individual to independently manage what they commit.

1

u/electrodragon16 19h ago

I like to add language/project specific stuff to .gitignore then add .gitignore to itself so editor specific things can be set by people themselves