Force Push
In one line
Force pushing overwrites the remote branch with your local history, potentially destroying commits that others have pushed.
In simple words
git push --force (or -f) overwrites the remote branch with your local version, discarding any commits on the remote that you do not have locally. It is the nuclear option of pushing.
Force push is needed after rewriting history with rebase or amend — the remote must be overwritten to match your new history. But if someone else has pushed commits you do not have, those commits are destroyed on the remote.
The safer alternative is git push --force-with-lease, which only force-pushes if the remote is at the same commit you last fetched. If someone else has pushed, the force push is rejected, preventing you from destroying their work. Always prefer --force-with-lease over --force.
Example
# Dangerous: may destroy others' commits
git push --force origin feature
# Safer: only force-push if no one else has pushed
git push --force-with-lease origin featureForce push overwrites remote history. --force-with-lease is the safe version.
Related terms
Related Resources
Related Lessons
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.