Git Concepts Simulator
Practice Git in an interactive browser terminal with a visual repository model. Learn the working directory, staging area, local commits, branch pointers, remotes, fast-forward merges, fetch, and rebase.
Category: DevOps
Topics covered: git, version-control, terminal, branches, commits, merge, rebase, devops, educational, interactive
// simulator
Git Concepts Simulator
Practice Git in an interactive browser terminal with a visual repository model. Learn the working directory, staging area, local commits, branch pointers, remotes, fast-forward merges, fetch, and rebase.
Mental Model
Goal: Start by checking where the lab repository lives.
Type "help", run "git status", or follow the task above.
About this Git simulator
What you'll learn
- How the working directory, staging area, local repository, and remote relate
- Why Git commits are snapshots with parent links
- How branches and HEAD work as movable pointers
- When a merge is a fast-forward instead of a merge commit
- How fetch updates remote-tracking branches without touching your work
- How rebase replays commits onto a new base
Key commands covered
- Inspect: git status, git diff, git log, git branch
- Snapshot: git add, git commit
- Branch: git switch, git merge
- Remote: git push, git fetch, git rebase
Concepts first
This lab is inspired by the “learn Git concepts, not commands” approach: commands make more sense once you can see what moved between the working tree, index, commits, branch labels, and remotes.
Browser-safe by design
This simulator does not run real Git. It models a small repository in the browser so you can experiment safely and build the mental model before using commands on real work.
Overview
Most Git confusion comes from not having a clear picture of where your changes are: in the working directory, in the staging area, in a local commit or on the remote. This simulator teaches that model first and the commands second. You start by looking around a small repository with git status and git log, then create a file, stage it, check the staged diff and commit it, and push it to the remote. Next you create a branch, commit on it and merge it back into main, watching how a branch is just a pointer that moves forward with each commit. The last lesson creates a feature branch, fetches what changed on the remote and rebases the branch onto origin/main, which shows the difference between fetching new commits and moving your own work on top of them. As you type, the simulator shows files moving through the working directory, the staging area, the local repository, the branch pointers and the remote, so you can see what changed instead of trusting the output text.
Try this
- In "Stage & Commit", add a file, run git diff --staged and commit it, watching the staging area empty.
- In "Branch Pointers", create a branch, commit on it and switch back to main to see which pointer moved.
- Finish "Fetch & Rebase" by fetching and rebasing a feature branch onto origin/main.
Frequently asked questions
- What is the Git staging area?
- Also called the index, it is where you assemble the exact changes that the next commit will contain. git add puts changes there and git commit records them.
- What is the difference between git fetch and git pull?
- git fetch downloads new commits from the remote without changing your branches. git pull fetches and then merges (or rebases, if configured) them into your current branch.
- Should I merge or rebase?
- Merging keeps the existing commits: a merge of diverged branches creates a merge commit, and a fast-forward just moves the branch pointer. Rebasing rewrites your commits on top of the target for a straight history. Avoid rebasing commits that others have already pulled.
Try next
// simulator
Idempotency and Retry Lab
Lose payment responses, replay idempotent requests, compare backoff with full jitter during an outage, and move exhausted jobs to a dead-letter queue.
// simulator
GraphQL N+1 and DataLoader Lab
Trace nested GraphQL resolvers, count N+1 SQL queries, batch users and comments with DataLoader, and discover why a loader cache must stay inside one request.
// simulator
Preview Environment Simulator
See how a pull request becomes a temporary copy of your app, complete with a private URL, safe test data, review checks, and automatic cleanup.