this post was submitted on 12 Apr 2026
456 points (99.4% liked)

Programmer Humor

31388 readers
784 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] otter@lemmy.ca 14 points 1 month ago (2 children)
rm -rf *

git add -A
git commit -m "oops."

rm -rf .git
git init
git add .
git commit -m "bye."

git push origin main --force
[–] black_flag@lemmy.dbzer0.com 15 points 1 month ago (1 children)

rm-ing .git isn't gonna work cuz you'll have to re-add the remotes.

[–] otter@lemmy.ca 5 points 1 month ago (1 children)

Oh good point 🤦

So maybe instead, we can clear all local + remote branches and tags, create a blank branch, delete main, rename the blank branch to main, then delete .git

Although the OP says that we can merge anything, and we might not have access to mess with branches

[–] ozymandias117@lemmy.world 3 points 1 month ago (1 children)

Or just git push origin --force blank:main

[–] fartographer@lemmy.world 2 points 1 month ago

Live your best life. git pull blindly.

[–] otter@lemmy.ca 3 points 1 month ago (1 children)

I'm not sure about the git history wipe, I can't test it myself right now

[–] Midnitte@beehaw.org 6 points 1 month ago (1 children)

Just test it on production, you could do it right now

[–] otter@lemmy.ca 3 points 1 month ago

Goodbye fedecan.ca