this post was submitted on 25 Oct 2023
297 points (97.7% liked)

Programmer Humor

32050 readers
1428 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 15 points 11 months ago (6 children)

How do you accidentally force push lol

[–] [email protected] 22 points 11 months ago (3 children)

I assume the accident was not to force push, but to the wrong branch

[–] [email protected] 3 points 11 months ago* (last edited 11 months ago) (1 children)

This is why I always git push origin +branch_name

[–] [email protected] 1 points 10 months ago* (last edited 10 months ago)

My go-to these days is to push the current branch, dynamically.
git push origin HEAD

Depending on the VC, HEAD has different prefix/suffixes to make it work.

Edit: formatting, also I never checkout master I do origin/master so I cannot even push it with this method. I think

load more comments (1 replies)
load more comments (3 replies)