WEEK 7 · LESSON 8 · TOPIC 2 OF 11 · Pushing Local Commits

Pushing Local Commits

Lesson progress

0% Complete

SECTION 1 OF 1

In this topic · 1 sections
  1. Overview

Overview

To send the local main branch to the remote named origin, use:

git push origin main

Here, origin identifies the remote repository and main identifies the branch being pushed.

Pushing main does not automatically push other local branches. To publish staging:

git checkout staging
git push origin staging

If staging does not yet exist on the remote, the push creates the remote staging branch and sends its commits.

The same pattern applies to development:

git checkout development
git push origin development

Each branch is synchronized independently.