Files
developer-roadmap/roadmaps/git-github/content/git-push---force@OQOmxg9mCfcjt80hpvXkA.md
T
Arik Chakma 274082fd77 feat: clean roadmap content and sync scripts (#10181)
* refactor: clean to roadmap content

* refactor: move shared helpers into scripts/lib
2026-07-28 05:45:17 +06:00

691 B

git push --force

git push --force overwrites the remote branch's history with the local branch's history, even if they've diverged. This is necessary after rewriting local commits, like through a rebase, since a normal push would be rejected due to mismatched history. Because it can overwrite others' work on a shared branch, git push --force-with-lease is often recommended instead, since it fails if the remote has changes the local branch doesn't know about.

Visit the following resources to learn more: