← All labs

// hands-on lab

Git Basics — Initialize, Stage, Commit and Inspect

~15 min

Learn the Git workflow by creating a repository, staging files, making a commit, and inspecting repository status and history.

Git Basics — Initialize, Stage, Commit and Inspect

In this lab, you will practice the basic Git workflow inside a simulated Linux environment.

Your task is to create a Git repository, add a file, stage your changes, create your first commit, and inspect the repository using Git commands.

Tasks

  1. Create a directory named my-project.

  2. Enter the directory.

  3. Initialize a Git repository.

  4. Create a README.md file.

  5. Add some content to the README.

  6. Check the repository status.

  7. Stage the README file.

  8. Create your first Git commit.

  9. Check the repository status again.

  10. View the commit history.

Focus on understanding the basic Git workflow:

Working directory → Staging area → Commit

// checklist 0/8

Sign in to save checklist progress.

Linux practice shell · instant, in-page · ephemeralOpen in new tab ↗
practice-shell — bash
Git Basics Lab
Practice the Git workflow: working tree -> staging -> commit.
 

Instant practice shell (simulated) — everything for this lab works here. Need the real thing? Open the full Linux VM ↗