Skip to content
BENIBIX Learn

Git Push

Development🔀 Version ControlRemotes

Also known as Push

Sending your new commits up to the shared remote. Then the team can get them.

Think of it like

Think of it like a letter in your bag. Until you post it, no one else can read it.

Example

Emma pushes her dark-mode commits at the end of the day. The next morning, Jack pulls them and sees the new look.

Why it matters

Work that is not pushed only exists on one laptop. Pushing shares it and backs it up.

Definition

To push is to send your new commits from your computer to a remote. After a push, your team can see and pull your work. Git refuses the push if the remote has commits you do not have yet. Then you pull first, sort out any conflicts and push again. A push only sends commits, so unsaved or uncommitted work stays behind.

Example code

console
$ git push -u origin main
To https://example.com/ada/shop.git
 * [new branch]      main -> main
branch 'main' set up to track 'origin/main'.
The first push sends main and links it to the remote copy.

Common mistake

Using git push --force on a shared branch. It wipes out commits that others pushed.

Key takeaways

  1. 1
    Up to the remote. Your commits leave your machine.
  2. 2
    Pull first if told. Git refuses when you are behind.
  3. 3
    Commits only. Uncommitted work stays home.

Compare

Learn it properly