Practical Guides

Real-World Git Scenarios

Step-by-step guides for common Git situations you'll encounter in real projects. Each scenario includes interactive visualizations to help you understand what's happening.

15Scenarios
5-10Minutes Each
100%Visual
↩️Undo
🌿Branch
πŸ”€Merge
⚑Resolve
🎯Beginner

Your First Git Commit

Turn a plain project folder into a repository: init, stage, commit, and keep going.

5 min
Easy
10 steps
Start Scenario
πŸ“₯Beginner

Cloning a Repository

Join an existing project: clone it from GitHub, explore it, and publish your first branch.

5 min
Easy
8 steps
Start Scenario
↩️Recovery

Undo the Last Commit

Amend, soft reset, hard reset, reflog recovery and revert β€” pick the right undo for each situation.

8 min
Medium
13 steps
Start Scenario
🌿Collaboration

Feature Branch Workflow

The everyday team loop: branch, commit, push, keep up with main, merge and clean up.

10 min
Medium
14 steps
Start Scenario
βš”οΈCollaboration

Resolving a Merge Conflict

Two branches change the same lines. Read the conflict markers, resolve, and finish the merge.

7 min
Medium
10 steps
Start Scenario
πŸš‘Enterprise

Hotfix a Production Release

Patch a released version on its release branch, tag it, and carry the fix back to main with cherry-pick -x.

10 min
Hard
12 steps
Start Scenario
πŸ”„Enterprise

Rebase a PR onto the Latest Main

main moved and conflicts with your open pull request. Rebase, resolve, and update the PR with --force-with-lease.

9 min
Hard
11 steps
Start Scenario
🧹Enterprise

Clean History Before Merging

Squash β€œfix typo” commits and reword vague messages with interactive rebase, then fast-forward main.

8 min
Hard
10 steps
Start Scenario
πŸ’ΎRecovery

Recover Lost Work

A branch deleted with -D, a reset that went too far β€” the reflog and ORIG_HEAD bring everything back.

7 min
Medium
10 steps
Start Scenario
βͺEnterprise

Roll Back a Bad Merge

A merged feature broke production. Undo the whole merge on shared main with git revert -m 1.

7 min
Hard
9 steps
Start Scenario
πŸ”€Collaboration

Urgent Fix Mid-Feature

Park half-done work with git stash, ship an urgent fix on main, then pick up exactly where you left off.

7 min
Medium
12 steps
Start Scenario
🏷️Enterprise

Tag and Ship Versions

Mark every release with an annotated tag, push tags, and go back to any shipped version.

6 min
Medium
9 steps
Start Scenario
βœ‚οΈEnterprise

Split a Commit for Review

A reviewer asks for smaller commits. Undo the commit and re-stage it hunk by hunk with git add -p.

6 min
Hard
8 steps
Start Scenario
πŸ—‘οΈEnterprise

Clean Up Merged Branches

Prune branches deleted on GitHub, find which local branches are merged, and delete them safely.

6 min
Medium
11 steps
Start Scenario
βš™οΈEnterprise

Shallow Clones in CI

CI clones with --depth 1 for speed. See what a shallow history can’t do, then deepen or unshallow it.

5 min
Medium
6 steps
Start Scenario