Fundamentals

Push

Pushing sends commits from your local repository to a remote such as GitHub, making them available to everyone else.

Sending your commits out

Pushing sends the commits you made locally to a remote repository such as GitHub, publishing history that until then existed only on your machine.

This is Push origin in GitHub Desktop, or git push on the command line. What matters is which remote you are sending to and which branch you are updating.

How it differs from committing

  • Commit: record a change in your local Git history
  • Push: send recorded commits to the remote

Saving a file, or even committing, normally changes nothing on GitHub. Equally, if there is nothing committed, a push sends nothing new.

Pushing is not publishing

Pushing to GitHub and deploying a site or app to its users are separate operations. That said, many projects deploy automatically when the main branch is pushed.

On an automated project, find out which branch triggers tests and which triggers a release.

Do not force a rejected push

If someone else updated the remote first, an ordinary push is refused. That refusal is a safeguard against overwriting history.

Pull or fetch first and look at the difference. Force-pushing without understanding what it does can destroy shared history.

origin is simply the conventional name given to the remote you cloned from. Push origin means send to the remote called origin — it is not a synonym for GitHub. On projects with several remotes, check the destination carefully.

The first push of a new branch may set up the link between your local branch and the remote one. After that the command is shorter, but checking which branch you are on remains worth doing.

Related terms

Sources and review information

Last reviewed July 21, 2026

Back to the AI Glossary

Search this site