Learn Everything

Paths/DevOps Engineer/Git / Git Basics

Guided Taskbeginnerubuntu:24.04 + gitAsk AI

Your First Commit

Initialize a Git repository in ~/project, stage every file and create the initial commit with the message 'init'. Every command is explained in the walkthrough.

Validator

⏱ 0:00

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

01Requirements

live checks
  • ~/project is a Git repository○
  • One commit with message 'init' exists○

02Walkthrough

9 steps
  1. 01

    Create the project folder

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

    mkdir ~/project
  2. 02

    Enter the project folder

    cd changes your current directory. Run git init here in the next step — not in your home directory.

    cd ~/project
  3. 03

    Initialize the repository

    git init turns the current directory into a Git repository by creating a hidden .git folder. Run this inside ~/project, not your home directory.

    git init
  4. 04

    Add a file to commit

    An empty repository has nothing to commit. Create a README so the first commit has content.

    touch README.md
  5. 05

    Stage everything

    git add . stages every new or changed file in the current directory. Staging is Git's staging area: you pick what goes into the next commit.

    git add .
  6. 06

    Check the status

    git status shows the branch you're on and what's staged. README.md should be listed as a change to be committed.

    git status
  7. 07

    Create the commit

    git commit records the staged snapshot permanently. The -m flag supplies the message inline — 'init' is the convention for a first commit.

    git commit -m "init"
  8. 08

    Verify the history

    git log lists the commit history newest first. You should see one commit with the message 'init'.

    git log
  9. 09

    Submit for validation

    The validator checks that ~/project is a Git repository and that a commit with the message 'init' exists in it.

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