Files
git-workshop/module-01-basics
2025-12-19 11:27:45 +01:00
..
2025-12-19 11:18:25 +01:00
2025-12-19 11:18:25 +01:00
2025-12-19 11:18:25 +01:00

Module 01: Git Basics

Learning Objectives

  • Understand what a git repository is
  • Learn the basic git workflow: modify → stage → commit
  • Use git status to check repository state
  • Use git add to stage changes
  • Use git commit to save changes

Challenge

In this challenge, you'll learn the fundamental git workflow.

Setup

Run the setup script to prepare the challenge:

.\setup.ps1

This will create a directory called challenge with some files that need to be committed.

Your Task

  1. Navigate into the challenge directory
  2. Initialize a new git repository
  3. Check the status of your repository
  4. Stage the file welcome.txt
  5. Create a commit with the message "Add welcome file"
  6. Stage the file instructions.txt
  7. Create a commit with the message "Add instructions"

Key Concepts

  • Repository: A directory tracked by git, containing your project files and their history
  • Working Directory: The files you see and edit
  • Staging Area (Index): A preparation area for your next commit
  • Commit: A snapshot of your staged changes

Useful Commands

git init                    # Initialize a new git repository
git status                  # Show the working tree status
git add <file>              # Stage a file for commit
git commit -m "<message>"   # Create a commit with a message

Verification

Once you think you've completed the challenge, run:

.\verify.ps1

This will check if you've successfully completed all the steps.