Push: Sending your local commits to the shared remote repository, such as GitHub, so that others can see them and they are backed up.

Example

You make three commits on feature/login-fix, then run git push. The branch appears on GitHub, and you open a pull request from it.

Commit vs Push

A commit saves changes in your local repository only. A push copies those commits to the remote. Until you push, nobody else can see your work, and it isn't backed up if your laptop fails.

Common Push Situations

SituationWhat to do
First push of a new branchgit push -u origin branch-name
Push rejected: remote has new commitsPull first, resolve any conflicts, then push
Push rejected: protected branchPush your own branch and open a pull request
Authentication failedSet up an SSH key or personal access token

Never Push These

  • Passwords, API keys, or tokens. Use a .gitignore and environment variables.
  • Large build files or dependency folders.
  • Code that doesn't compile to a shared branch.

Also avoid git push --force on shared branches; it can delete others' work. If someone suggests it, make sure you understand why.

Related terms

Previous term: Pull Request (PR)  |  Next term: QA (Quality Assurance)

Related guides

Frequently asked questions

What does git push do?

It sends your local commits to the remote repository, so others can see them.

Why is my git push rejected?

Usually because the remote has new commits you don't have, or the branch is protected. Pull first, or push to your own branch.

What is git push --force?

It overwrites the remote branch with your version, which can delete others' commits. Avoid it on shared branches.

How often should I push?

At least at the end of each working day, and whenever you want feedback or a backup of your work.

Explore more internship terms

The IT Internship Glossary explains 199 terms you will hear before and during your internship, with simple definitions and real examples.

Browse all 199 terms
Dhaivat Ajwaliya

About the author

Dhaivat Ajwaliya

Dhaivat has 16+ years of experience in the IT industry, working on AI and cloud technologies, project delivery, and engineering leadership. He has interviewed and mentored many interns, wrote The Lost Intern, and runs the non-commercial Career Impact Initiative, mentoring students for free.