How do I force the overwriting of a git branch I pushed and rebased?
Using Git, I was working on a feature branch. I pushed the branch to github so someone could look at it. Then, it had been a while, so I rebased it. How do I push my rebased branch over the old one? What pitfalls must I avoid? I think it's just git push --force (or --mirror?), but I'm never sure.
Some relevant links:
You want to use git push --force but please remember that you are rewriting public history.
Rewriting public history is a very bad idea. Anyone else who may have pulled the old history will have to git pull --rebase and even worse things if they have tagged or branched from the rewritten history, so you must publish your humiliation so they know what to do.
The server may not allow this (but will on github). See receive.denyNonFastForwards (git-config)