Git Force Push Branch

I had a problem where I want to push my branch and overwrite what was the on the server.

I kept receiving an error telling me to merge. I did not want to merge and found a way to force push a branch.

In general you don’t want to do this unless you absolutely have to.

git push -f origin <branch>

This Stackoverflow question and answers helped me.

http://stackoverflow.com/questions/10298291/cannot-push-to-github-keeps-saying-need-merge

Share this Story
Load More Related Articles
Load More By Nick Escobedo
Load More In How-To's

Check Also

Why Definition of Ready Protects a Dev Team and the Role of an Engineering Manager

When a dev team is stuck, blocked, or forced to carry tickets into the next sprint, tickets that aren’t ready are often to blame. One of the biggest hidden productivity drains is work that sounds ready but isn’t. Protecting a team’s time means protecting the work that comes in, not just how the work gets done.