0/4

Lesson05

intermediate

Push a Branch to origin

Goal

Publish a new branch with git push -u, so later pushes and pulls know where to go.

Your weather alerts feature lives on feature/alerts, which exists only on your machine so far. Your team's repository, origin, has never seen it.

Push the branch, make origin/feature/alerts its upstream, then commit the styles waiting in alerts.css and push again, this time with a plain git push.

Objectives

0/4
  1. origin has feature/alerts, at the same commit as yours. (Current objective)
  2. feature/alerts tracks origin/feature/alerts. (Not started)
  3. alerts.css is committed as Style weather alerts. (Not started)
  4. origin has Style weather alerts too. (Not started)

Your task nowStep 1 of 4

origin has feature/alerts, at the same commit as yours.

Need help?

Reference

What does this repository know about?

$ git remote -v

origin	gitdojo://simulated/origin.git (fetch)
origin	gitdojo://simulated/origin.git (push)

One remote, origin. The gitdojo://simulated URL is GitDojo's simulated server: it lives inside your browser workspace and is the only remote you can reach here.

The first push of a branch

$ git push -u origin feature/alerts

To gitdojo://simulated/origin.git
 * [new branch]      feature/alerts -> feature/alerts
branch 'feature/alerts' set up to track 'origin/feature/alerts'.

-u (--set-upstream) remembers origin/feature/alerts as the branch's upstream. From then on, a bare git push or git pull on this branch knows where to go, and git status reports how far ahead or behind you are.

Preparing your workspace…

Repository Graph

Click a commit to inspect it

0 commits

Working Tree

Not a Git repository yet

No unstaged changes

Your working tree matches the staging area.

Staging Area

Files prepared for the next commit

No staged changes

Use git add to prepare files for your next commit.

Repository

Committed history

No commits yet

Use git commit to record staged changes.