Hacker News new | past | comments | ask | show | jobs | submit login

This doesn't fix the problem since you still can do a lot of damage doing that on a (perhaps wrong) feature branch.



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


That's where reflog comes in handy




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: