git push

The command that uploads your commits to a remote and moves the remote's branch to match.

In more detail

The remote accepts the push only if it fast-forwards its branch; if someone else pushed first, or you rewrote history, it is rejected. git push -u origin branch also sets the upstream so later pushes need no arguments. Tags are pushed only when you name them, as in git push origin v1.0.

Example

git push origin main

Related terms

Taught in

References