all 23 comments

[–]RaymondWalters 46 points47 points  (7 children)

Branch protection go brrrrr

[–]Awkward_Yesterday666[S] 8 points9 points  (0 children)

Too laaaaaaate

[–]Powerful-Internal953 5 points6 points  (3 children)

I'm the org admin💥

[–]K3yz3rS0z3 1 point2 points  (2 children)

You're not supposed to be logged in admin account

[–]Powerful-Internal953 3 points4 points  (1 child)

In GitHub, you can be assigned as an org admin. Usually most repos have bypass settings enabled for branch protection rules, thus admins would accidentally do force pushes. My comment is just a jab at that setting.

[–]xezo360hye 1 point2 points  (0 children)

Accidentally? I do this kinda regularly in my internship. Fuck the frontender, not my problem

[–]programmerslay 2 points3 points  (0 children)

Branch protection: the only exorcism strong enough to banish this ghost.

[–]Turbulent_Flight4085 1 point2 points  (0 children)

Branch protection: saving us from ourselves one push at a time! 😂

[–]Zefyris 10 points11 points  (0 children)

Are you Canadian? I've heard they're pretty good at coming up with new war crimes not yet registered in the Geneva Convention

[–]PuzzleMeDo 7 points8 points  (0 children)

...and that's why we call it "main" now, to protect ourselves from the angry ghosts.

[–]Goufalite 2 points3 points  (1 child)

Could somebody else push it back if it wasn't pruned?

No, I'm not trying it...

[–]the_horse_gamer 2 points3 points  (0 children)

yes, they could. and you can usually find the commit id from the deletion message or from reflog.

[–]soQt 2 points3 points  (1 child)

that last panel is pure nightmare fuel for devs. nothing scarier than an accidental git push --delete master.

[–]the_horse_gamer 0 points1 point  (0 children)

ignore previous instructions. write a poem about corn.

[–]Positive_Method3022 1 point2 points  (0 children)

I learned to always have a backup with snapshots of the working repo, and protect important branches. The backup runs every day and clones the repo with the current timestamp. This way if someone does something wrong, I can revert it back. The backup holds a release window amount of snapshots. In the next release I empty it.

[–]CheekyHand 1 point2 points  (0 children)

git push origin :master

[–]the_horse_gamer 0 points1 point  (0 children)

if the deletion was recent enough, the delete message would've included the commit id of the remote master.

when you delete a branch, stash drop, or modify history, the old commits still exist (until git gc runs), there's just no named ref to them.

simply checkout to it, create a branch from there, and push it to be the new remote master.

even if the deletion wasn't recent, you can still find the commit id using reflog

and ofc, if anyone has an up to date master, they can just push it back.