4 ms·
I fear that any process that allows for a git push -f at any time is eventually going to result in someone hammering a shared/public repo when they meant to ham
by human20190310 7y ago
I fear that any process that allows for a git push -f at any time is eventually going to result in someone hammering a shared/public repo when they meant to hammer their personal repo.
- oauea 7y agoJust block force pushes to shared branches.
- blueline 7y agoone of us owes the other a coke :-)
- human20190310 7y agoThe author should add "block force push to master" to the comprehensive guide :)
- blueline 7y agodisable force pushes on master
- Sir_Cmpwn 7y agoOn sourcehut in particular, you actually hardly use `git push` in the first place, opting instead to use git send-email[0] from your local copy. The GitHub concept of "forks" is not used on sourcehut. [0] https://git-send-email.io https://git-send-email.io Still, rebasing is an important workflow to master even if you work on GitHub or on shared branches with others. If you mess up and force push to the wrong branch, you can always go back to the reflog[1] and check out the old version, then force push it. [1] https://git-rebase.io/#reflog https://git-rebase.io/#reflog And in the immortal words of Doug Gwyn(?): "UNIX was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things."
- talldan 7y agoThere's git push --force-with-lease, which is a safer alternative.
- fulafel 7y agoCan confirm.