A Nicer Force Git Push

Most of us have had to git push –force before to overwrite the remote history of your repository. That command should be used with caution and you also might want to consider using git push –force-with-lease instead. It will block your force push if the remote branch has been updated and you don’t have the latest fetched in your repository. This might prevent you from throwing away someone else’s work without realizing it 😳

git push origin master --force-with-lease

Read more about it here

Instagram Post