1261
Hey, I'm new to GitHub! (programming.dev)
you are viewing a single comment's thread
view the rest of the comments
[-] Moghul@lemmy.world 44 points 1 year ago

The machine spirit requires that you submit the correct incantations

[-] No_Eponym@lemmy.ca 1 points 1 year ago

The thingmabob that does the job is bippity-boppity-boo.

[-] ekky@sopuli.xyz 1 points 1 year ago* (last edited 1 year ago)

like this?

# Let Git take a rest with some yummy awk chocolate logs with delicious nuts and seeds, and don't be pushy!
git reset --hard $(git log --reverse | sed -n 1p | awk -F "[ ]" '{print $2}') && git push -f

EDIT: Don't actually run it.

[-] subtext@lemmy.world 2 points 1 year ago

Can you explain what this does? I’m thinking something along the lines of reverting all commits except the very first one?

[-] ekky@sopuli.xyz 3 points 1 year ago

You are correct! It sets HEAD to the first commit and then force pushes, deleting everything after HEAD.

Though, it only affects the currently selected branch.

this post was submitted on 20 Feb 2024
1261 points (98.4% liked)

Programmer Humor

25312 readers
1044 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