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:

Answers


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)


Need Your Help

Weighted Marker Clusterer

javascript google-maps google-maps-markers marker markerclusterer

Google Maps has a nice feature called Marker Clusterer which lets you to apply grid-based clustering to a collection of markers.

Using a dynamic precision value in number_to_currency based on the decimal value

ruby-on-rails ruby decimal rounding

Thoughout our app we use number_to_currency(value, :precision => 2). However, we now have a requirement whereby the value may need displaying to three or more decimal places, e.g.