297
We've all been there
(feddit.de)
Post funny things about programming here! (Or just rant about your favourite programming language.)
How do you accidentally force push lol
I assume the accident was not to force push, but to the wrong branch
I hope they learned the value of protecting your branches.
This is why I always
git push origin +branch_name
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
I was wondering the same. Any branch that has any logic besides a ci build attached to it should have been force push protected by default...
Git rebase makes it possible getting used to do so