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
  • PHP

    Using array_reduce to Transform Data

    First, why we might transform data? If we have raw data from a database and need to send data to an ...
  • Programming

    Selecting Your Next App Dependency

    We often turn to open source or proprietary packages for adding functionality to our apps. Here are some key points and questions to ask when selecting your next dependency.
  • Tips

    Trade-offs

    As developers we work with non-technical people and we can do a better job connecting with them. Non-technical people don’t care ...
  • Life Pro Tip Tips

    Mental Snapshots

    Think back to a time where you accomplished something you had no idea how to do or when you accomplished something ...
  • Laravel Programming

    The Importance of Eager Loading Laravel Relationships

    Problem Page took over 30 seconds to load locally on a local Vagrant virtual machine. After investigating the results were astonishing, ...
  • JavaScript Vue.js

    Website Launch: Champion Spotlight

    I launched a new website dedicated to finding champion spotlights: http://championspotlight.lol for the game League of Legends (LoL). If you haven’t ...
Load More Related Articles
  • PHP

    Using array_reduce to Transform Data

    First, why we might transform data? If we have raw data from a database and need to send data to an ...
  • Programming

    Selecting Your Next App Dependency

    We often turn to open source or proprietary packages for adding functionality to our apps. Here are some key points and questions to ask when selecting your next dependency.
  • Tips

    Trade-offs

    As developers we work with non-technical people and we can do a better job connecting with them. Non-technical people don’t care ...
  • Life Pro Tip Tips

    Mental Snapshots

    Think back to a time where you accomplished something you had no idea how to do or when you accomplished something ...
  • Laravel Programming

    The Importance of Eager Loading Laravel Relationships

    Problem Page took over 30 seconds to load locally on a local Vagrant virtual machine. After investigating the results were astonishing, ...
  • JavaScript Vue.js

    Website Launch: Champion Spotlight

    I launched a new website dedicated to finding champion spotlights: http://championspotlight.lol for the game League of Legends (LoL). If you haven’t ...
Load More By Nick Escobedo
Load More In How-To's

Check Also

Using array_reduce to Transform Data

First, why we might transform data? If we ...