Skip to content

    Force push

    Reading time: 2 min.Editorially reviewed on:

    Definition

    A force push can reset a remote Git reference despite differing history.

    A force push transmits a Git state by overriding certain protection checks for updating remote references. This can cause a remote branch to point to a history that does not include commits previously present there. The process requires coordinated responsibilities.

    Simply explained

    You set the shared version pointer to your state, even if its history does not simply continue from the previous one.

    Why it matters in practice

    The procedure is relevant for intentionally rewritten branch history but can displace the work of other contributors from the visible branch history.

    Example from business

    Possible example: After a coordinated rebase, a developer updates her own working branch on the server with an appropriate protection rule.

    Limits and pitfalls

    • Unchecked forcing can overwrite others' changes. --force-with-lease checks expected reference states but does not replace coordination or protection of shared branches.

    Origin & history

    Force push is part of Git's distributed reference model: local histories can be rewritten while remote branches initially still show the old history.

    Use in mid-sized companies

    • A development team defines which working branches allow history changes and protects the main branch from unintended forced overwrites.

    Frequently asked questions

    Is --force-with-lease the same as --force?

    No. The lease variant couples the update to an expected remote state and can abort if there is a discrepancy.

    Sources

    Editorially reviewed on:

    On this page

    Next step

    Put knowledge into practice