git push Upload your commits to a remote

Sends commits from your local branch to a remote repository such as GitHub so others can see them. It fails if the remote has commits you do not have, to protect their work.

Synopsis

git push [OPTION]... [REMOTE [BRANCH]]

Common options

Option or formWhat it does
-u, --set-upstreamRemember the remote branch so later git push and git pull need no arguments
--force-with-leaseOverwrite the remote only if nobody else has pushed since you last fetched
--tagsPush all tags
--delete BRANCHDelete a branch on the remote
-n, --dry-runShow what would be pushed
--force, -fOverwrite the remote regardless. Risky on shared branches

Examples

Push the current branch
git push
Publish a new branch and track it
git push -u origin feature/search
branch 'feature/search' set up to track 'origin/feature/search'.
Push after rebasing a branch only you use
git push --force-with-lease
Delete a remote branch
git push origin --delete feature/search
Push a tag
git push origin v1.2.0

Notes

See also

Last reviewed 2026-10-09.