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.
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.
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
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
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
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')
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
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
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.
git status -sbShort-format status showing active branch and staged modifications
git log --oneline --graph --decorate -n 15Display visual commit tree graph with branch tags
git checkout -b feature/auth-flow mainBranch off main and switch working directory immediately
git add -pInteractively stage specific code hunks rather than whole files
git commit --amend --no-editIncorporate staged changes into the most recent commit
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.