News for hackers. Stuff that matters.
Re:I Kind of Like Rebasing by necessary on Saturday June 22, 2024 @10:25PM (#40764210)
Git hosting platforms generally have controls that allow you to prohibit force pushes on protected branches (i.e. master)
Re:I Kind of Like Rebasing by The_Colonel on Sunday June 23, 2024 @01:14AM (#40764985)
This doesn't fix the problem since you still can do a lot of damage doing that on a (perhaps wrong) feature branch.
Re:I Kind of Like Rebasing by SOLAR_FIELDS on Sunday June 23, 2024 @02:19AM (#40765165)
It certainly diminishes it significantly. Very few people are usually collaborating on the same branch together that isn’t the main branch in most orgs. So the chances of you destroying yours or someone else’s work that way is pretty low. You can also branch protect any arbitrary branch, at least on GitHub, though I’ve never been in an org that protects branches other than the main one, besides an org that used release branches. I’ve also never seen someone clobber someone else’s feature branch, though it probably does happen. Much more often people are accidentally clobbering their own branches.

The ability to rewrite history on feature branches is powerful in a good way and slots right into the way Git is philosophically designed. I would probably not be interested in removing that feature to prevent the rare case that someone footguns themselves or someone else

Re:I Kind of Like Rebasing by nickkell on Sunday June 23, 2024 @03:49AM (#40765506)
That's where reflog comes in handy