git push

Upload commits

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
git push --force-with-leaseInstead of --force
git push --dry-runPreview what would be pushed
What it does

Sends local commits to a remote branch. See the flags and examples below, and run `man git` for the full reference.

Common flags
FlagMeaning
--force --forceOverwrite remote history⚠ Can destroy teammates’ commits.
--force-with-lease --force-with-leaseSafer force push
--tags --tagsPush all tags
--delete --deleteDelete a remote branch
Examples
git push origin mainPush main · explain & risk-check →
git push --force-with-leaseSafer force push · explain & risk-check →
Related
git pull git fetch
Open the full explainer →More in Git

Reference text is hand-written and may be incomplete — check man git for your version. Test destructive commands on a non-production system first.