Git & GitHub·Version control

Why version control

Understand the three states of Git and start your first repository.

Beginner 10 min read Lesson 1 of 480 Challenge included
What you will be able to do
  • Explain the working tree, staging area and history
  • Initialise a repo
  • Read status output

Git records snapshots of your project. Instead of final_v2_REAL.zip, you get a complete, navigable history with authorship and intent.

  1. 01
    Working tree

    The files you are editing right now.

  2. 02
    Staging area

    The exact changes you have chosen for the next snapshot.

  3. 03
    Repository

    The permanent commit history stored in .git.

terminalTerminal
git init
git status

git add index.html styles.css
git commit -m "Build the landing page hero"

git log --oneline
Your turn

Make a first commit

Easy

Stage README.md and create a commit with the message "Add project readme".

BASH · starter
# your commands here
Check your understanding before moving on.
Knowledge checkQuestion 1

What does git add do?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Commits and history
Lesson 1 of 480 · 0% of course