Learn Everything

Paths/DevOps Engineer/Git / Remotes & GitHub

Guided Taskbeginnerubuntu:24.04 + gitAsk AI

Connect to a Remote

Local commits are only half the story. Add GitHub as a remote and push your branch. In this lab the push is simulated — the workflow is identical to the real thing.

Validator

⏱ 0:00

IDLE — checks run live as you type commands; submit when done

01Requirements

live checks
  • Remote 'origin' points at a github.com URL○
  • Branch pushed to the remote○

02Walkthrough

10 steps
  1. 01

    Recreate the repository

    Every lab starts from a fresh shell — ~/project doesn't exist yet. mkdir makes it.

    mkdir ~/project
  2. 02

    Enter the repository

    Remotes are stored per repository inside .git/config.

    cd ~/project
  3. 03

    Initialize with one commit

    A push needs committed work. git init, then give the repository a base commit.

    git init
  4. 04

    Create a file to push

    A README is enough — the point of this lab is the remote, not the content.

    touch README.md
  5. 05

    Stage and commit

    Stage everything, then record the 'init' commit on main.

    git add .
  6. 06

    Commit

    Now there is a commit on main that the later push will upload.

    git commit -m "init"
  7. 07

    Add the remote

    git remote add origin <url> stores the URL under the name 'origin' — the conventional name for the repository you cloned from or push to. On GitHub, create an empty repo first and copy its URL.

    git remote add origin https://github.com/learner/demo.git
  8. 08

    Verify the remote

    git remote -v lists every remote with its fetch and push URLs. Both should show your github.com URL.

    git remote -v
  9. 09

    Push

    git push uploads committed work. -u sets upstream tracking so future pushes can be a bare 'git push'.

    git push -u origin main
  10. 10

    Submit for validation

    The validator checks that origin points at github.com.

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — ubuntu:24.04 + git

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list