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
| Situation | What to do |
|---|---|
| First push of a new branch | git push -u origin branch-name |
| Push rejected: remote has new commits | Pull first, resolve any conflicts, then push |
| Push rejected: protected branch | Push your own branch and open a pull request |
| Authentication failed | Set 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
- Commit: what you push.
- Pull: the opposite direction.
- Repository: the remote you push to.
- Pull Request (PR): usually opened right after pushing a branch.
Previous term: Pull Request (PR) | Next term: QA (Quality Assurance)
Related guides
- Build a GitHub Portfolio That Gets You Internship Interviews
- What to Do in Your First Week of an IT Internship
- Common IT Internship Mistakes
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