Learn Everything

Core Systems

Git

Distributed version control powering software development collaboration.

Git tracks changes in source code across distributed teams. Understanding Git's internal directed acyclic graph (DAG) of commits, tree objects, and blob hashes demystifies rebasing, cherry-picking, merge conflict resolution, and atomic commit practices.

beginnerEst. 4-6 hrs study time6 Live LabsPart of DevOps Engineer Path ↗

Virtual Lab Ready

Automated testing sandbox running in your browser.

Launch First Lab ⚡

No local installation required

Hands-on Practice

Interactive Terminal Labs

Real environment tasks with automated validation. Write real commands, verify state, and debug errors.

6 tasks available
LAB 01
beginnerGuided Task

Your First Commit

Topic: Git Basics

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.

Key Checks:

  • ~/project is a Git repository
  • One commit with message 'init' exists
Env: ubuntu:24.04 + gitOpen Lab ↗
LAB 02
beginnerPractice Task

Ship a Feature Branch

Topic: Branches & Merging

The daily Git loop: branch, commit on the branch, merge back to main. Create a branch called 'feature', commit on it and merge it into main.

Key Checks:

  • ~/project is a Git repository
  • Branch 'feature' exists and was merged into main
Env: ubuntu:24.04 + gitOpen Lab ↗
LAB 03
beginnerGuided Task

Connect to a Remote

Topic: Remotes & GitHub

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.

Key Checks:

  • Remote 'origin' points at a github.com URL
  • Branch pushed to the remote
Env: ubuntu:24.04 + gitOpen Lab ↗
LAB 04
intermediateScenario

Revert a Bad Commit

Topic: Fixing Mistakes

A teammate committed a bug and you need main clean again — without rewriting history that others already have. Undo the last commit with git revert, which adds an inverse commit.

Key Checks:

  • ~/project is a Git repository
  • A revert commit exists (message starts with 'Revert')
Env: ubuntu:24.04 + gitOpen Lab ↗
LAB 05
intermediatePractice Task

Write a .gitignore That Actually Works

Topic: Ignore Rules & Commit Discipline

A .gitignore is a list of patterns, not a list of files - one line can cover a thousand files. Create a repository with rules for environment files, logs and build output.

Key Checks:

  • ~/project is a Git repository
  • File ~/project/.gitignore exists and ignores environment files, logs and build directories
Env: ubuntu:24.04 + gitOpen Lab ↗
LAB 06
beginnerGuided Task

Use Conventional Commit Messages

Topic: Ignore Rules & Commit Discipline

Commit messages are read by humans and by release tooling. Learn the type prefix convention - feat for features, fix for bugs, chore for everything else.

Key Checks:

  • ~/project is a Git repository
  • A commit with message 'feat: add health endpoint' exists
Env: ubuntu:24.04 + gitOpen Lab ↗

System Design

Content-Addressable Object Storage

Understand how this tool operates internally before running production workloads.

Internal Mechanics

Every file, directory, and commit in Git is an immutable SHA-1/SHA-256 hashed object in the .git/objects database. Branches are simply lightweight pointer references to specific commit hashes.

Mental Model Rule of Thumb

Never treat Git as a black box. Understanding its boundary with the kernel, filesystem, and network stack prevents 90% of production outages.

Core Architectural Subsystems

Working Tree

The sandbox filesystem files you see and edit directly.

Index / Staging Area

Prepared state scheduled to be committed in the next revision snapshot.

Commit Object

Immutable node containing tree hash, author, committer, message, and parent pointer.

Refs / Branches

Movable pointers stored in .git/refs/heads/ referencing the tip of a line of work.

Developer Reference

Command Reference & Cheatsheet

Curated commands, flags, and one-liners tested for everyday operational productivity.

Status
git status -sb

Short-format status showing active branch and staged modifications

History
git log --oneline --graph --decorate -n 15

Display visual commit tree graph with branch tags

Branch
git checkout -b feature/auth-flow main

Branch off main and switch working directory immediately

Stage
git add -p

Interactively stage specific code hunks rather than whole files

Commit
git commit --amend --no-edit

Incorporate staged changes into the most recent commit

Recovery
git reflog && git reset --hard HEAD@{1}

Recover accidentally deleted commits or botched rebases

Fundamental Primitives

Key Terminology & Primitives

Core abstractions you must master to communicate and build with confidence.

Rebase vs Merge

Merge preserves historical chronology with a merge commit. Rebase replays commits linearly on top of a new base.

Detached HEAD

HEAD is pointing directly to a specific commit hash rather than a named branch pointer.

Fast-Forward

When target branch has no divergent commits, Git simply advances the branch pointer without creating a merge commit.

Reflog

Chronological log of where HEAD and branch references have pointed over the last 90 days — your ultimate safety net.

Production War-Stories

Common Pitfalls & Debugging Playbook

The exact errors that take down production systems and how to diagnose and resolve them.

!

Merge conflict markers in committed code

Symptom

<<<<<<< HEAD or >>>>>>> branch syntax committed accidentally.

Resolution

Carefully inspect git diff before committing. Configure a graphical or terminal merge tool (e.g. vimdiff, vscode).

!

Secret or credentials committed to history

Symptom

API keys or passwords pushed to remote repository.

Resolution

Rotating the credential immediately is mandatory. Rewrite Git history using git-filter-repo or BFG Repo-Cleaner.

Reliability Standards

Production Readiness Checklist

Review this checklist before deploying workloads to staging or production clusters.

  • ✓Protect main/master branches with required pull request reviews and status checks.
  • ✓Write atomic commits with descriptive imperative messages ('Fix memory leak in websocket handler').
  • ✓Maintain a thorough .gitignore excluding .env, node_modules, and build artifacts.
  • ✓Sign commits using GPG or SSH keys for cryptographic authenticity.
  • ✓Never rebase or force-push shared public branch histories.

Full Curriculum Track

Master Git as part of the DevOps Engineer path

Tools do not exist in isolation. Learn how Git connects with other systems, CI/CD pipelines, and infrastructure patterns.