Git Force vs Force with Lease

And When to Use Them

Mohammad-Ali A'RÂBI
ITNEXT
Published in
3 min readAug 12, 2021

--

Updated on 06.04.2022

When there is a git push you want to perform and the remote repo rejects it, there is a dangerous way to make it work:

git push --force

This dangerous method is so popular most IDEs have a special checkbox for it. But force has a sibling which is not getting enough attention:

git push --force-with-lease

The IDEs usually have no checkbox for force-with-lease, it’s not usually mentioned in the…

--

--

Writer for

Software Engineer at Haufe Akademie | Docker Captain | Content Creator