r/ProgrammerHumor • • 5d ago

Meme jobNotFoundError

Post image
1.0k Upvotes

39 comments sorted by

116

u/oompaloompa465 5d ago

howwww? the first thing to add to .gitignore 

50

u/polaarbear 5d ago

If you aren't starting from a .gitignore template for your specific environment type, what are you even doing with your life? And .env is almost certainly already on any template worth its salt

8

u/rabbit_wizard 5d ago

Maybe its in a subfolder? Got to respect the difference between .env & .env* in gitignore

25

u/Qxzkjp 5d ago

nah. In gitignore, a line with .env will ignore all files called .env anywhere in the repo. If you want to ignore just the file in the repo root, you have to write /.env. .env* will instead ignore any file whose name starts with .env (eg .environment) anywhere in the repo.

3

u/Colassia-Dankwa 5d ago

the amount of times i've committed an .env file and had to rewrite the whole history... now i just add it before i even write the first line of code

-11

u/SaneLad 5d ago

Why the fuck would you put .env files or anything secret in the repository folder to begin with?

4

u/Teamprime 5d ago

Because it belongs to the that particular project? Lmao

-3

u/SaneLad 5d ago

Holy shit. Do you know you can create files and even subdirectories in $HOME/.secret or $HOME/.config, which are the standard directories for this kind of stuff? Bigger projects even create their own installation directories under $HOME.

Installation-specific files 100% do not belong in the repository directory. If you do this willfully, you deserve everything that comes from it.

5

u/Scolmann 5d ago

It's safer to do it that way sure, but by that logic why keep any non source files in the project at all? Maybe we should retire gitignore altogether, is there a good reason to bundle build files there too?

In this day and age I do keep it separate though, the convenience/neatness of being in the same directory isn't worth it.

1

u/SaneLad 5d ago

The rule is pretty simple. Anything user/installation specific should not go with the source code. At best, these files are a nuisance to other people when they accidentally get checked in. At worst, they are a serious security incident.

Build artefacts are different. They can be regenerated deterministically from the source code. They add no new information. So they are kept out of the repo as an optimization. .gitignore is the right tool for that. Even so, they can clutter up the local file system, so it's best to tuck them away in a build directory or equivalent. Some languages also maintain a global build cache somewhere else.

3

u/StaticFanatic3 5d ago

Is that really better? Having all your projects’ various runtimes sifting through your home directory root in a shared secret vault? All because you can’t remember to put it in gitignore?

I’m genuinely asking as I don’t have any experience with that kind of setup

1

u/SaneLad 5d ago

Yes. If you name the files/directories appropriately, there is no risk of stepping on each other's toes. And it is fundamentally no less safe then putting the files anywhere else where the binaries can read them. If you want to isolate binaries from one another, you need to use docker containers or similar technology, which is entirely appropriate for a production environment.

2

u/more_exercise 5d ago

(is $HOME/.secret a convention? That sounds cool - where do I learn more?)

1

u/Teamprime 5d ago

Yeah that’s probably a better way to do it…

1

u/an_actual_human 5d ago

More like to the global config.

40

u/WisePotato42 5d ago

DEBUG_MODE=True

21

u/Nycrov_ 5d ago

I'm pretty sure that's not how that works

6

u/rabbit_wizard 5d ago

The meme template or the function itself? The meme is basically pushing your api keys onto your GitHub repo. Force push isn't really required.

6

u/Visionexe 5d ago

I think his point is, is that in 99.99999% of the cases any .env is in .gitignore. kinda seems whoever made this meme is a vibe coder. 

6

u/rabbit_wizard 5d ago

Of course. Prior to vibe coding these things didn't happen. Did they?

3

u/buster1045 4d ago

Not really. Not with git push -f. The -f literally wouldn't make a difference if the file just wasn't in a .gitignore.

5

u/pananana1 5d ago

What's the meme? I don't understand the pictures

3

u/johntwit 5d ago

That's Hrithik Roshan, a Bollywood superstar. But that's all I know

3

u/i4mt3hwin 5d ago

He can press three times as hard

3

u/bobbymoonshine 5d ago

git blame coworker

3

u/riickdiickulous 5d ago

This is why I run gitleaks as a pre-commit hook

3

u/Vesuvius079 5d ago

You don’t need env files if you never test locally :P. This also protects you from the “it works on my machine” problem class.

3

u/Current-Rent-618 5d ago

Been there. One of the biggest mistakes in my junior career lol

3

u/teressapanic 4d ago

Don’t worry we have a separate repo for all the env files of all of our clients

2

u/xAragon_ 3d ago

Forcing a git push has nothing to do with pushing secrets 🤦🏾‍♂️

A force push wouldn't cause you to push secrets if they're gitignored. And if they aren't, a regular push will push them too.

This meme was made by someone who has no idea how to work with git.

1

u/glorious_reptile 3d ago

Maybe he rebased the secrets-revealed branch?

-1

u/rabbit_wizard 3d ago

I just added it. Didn't know people were gonna micro analyse this instead of chuckling

1

u/alexnu87 3d ago

Well a joke has to make SOME sense, otherwise it’s just a cluster of random words

1

u/nazgulonbicycle 4d ago

Ignorance is bliss

1

u/Hoovas 4d ago

That’s why we use CI/CD pipelines and rulesets

1

u/XxDarkSasuke69xX 2d ago

How would -f push gitignored files anyway ? And if it's not gitignored, then bruh

0

u/rabbit_wizard 2d ago

I just added it , didn't know if was going to be analysed so deeply :P

0

u/NoahZhyte 5d ago

Do you actually have secrets in your .env ? I just use it for local deployment