Upload commits
high risk
git push --force-with-leaseInstead of --forcegit push --dry-runPreview what would be pushedSends local commits to a remote branch. See the flags and examples below, and run `man git` for the full reference.
| Flag | Meaning |
|---|---|
--force --force | Overwrite remote history⚠ Can destroy teammates’ commits. |
--force-with-lease --force-with-lease | Safer force push |
--tags --tags | Push all tags |
--delete --delete | Delete a remote branch |
git push origin mainPush main · explain & risk-check →git push --force-with-leaseSafer force push · explain & risk-check →Reference text is hand-written and may be incomplete — check man git for your version. Test destructive commands on a non-production system first.