Hacker News new | ask | show | jobs
by logophobia 5254 days ago
No, you are absolutely right. History rewriting is fine if you do it on a private branch, but on shared branches it can be problematic.

If there are updated refs on a shared branch, you need to use the --force flag when pushing, overwriting the previous refs. All the other people pulling will also need to use the --force flag to get their refs updated.

It could also lead to data loss on all the repositories that do this if something goes wrong. And it forces other team members to use the correct flag when pulling and otherwise dealing with cryptic error messages when they don't do this.

--amend is fine if you haven't pushed yet, otherwise it has the same problems as rebase for shared stuff.