Skip to main content

Overview

By default, Learn Git Branching launches in sandbox mode with a basic repository already created. This is a safe environment where you can enter any Git commands and experiment freely without consequences.

What is Sandbox Mode?

Sandbox mode provides:
  • A visual Git repository where you can see the effects of each command in real-time
  • The ability to execute any supported Git command
  • Tools to undo mistakes or start over completely
  • Support for simulating remote repositories with git clone
Sandbox mode is great for demonstrating Git concepts to others or testing command sequences before using them in real projects.

Available Commands

In sandbox mode, you have access to special utility commands beyond standard Git commands:

Undo Command

Use undo to reverse the effects of the last command you executed:
undo
This is useful when you make a mistake or want to try a different approach.
The undo command works in both sandbox mode and level challenges, making it easy to experiment without fear of breaking your repository state.

Reset Command

Use reset to start over with a clean slate:
reset
This clears your entire repository and returns you to the initial state. It works in both sandbox mode and levels.

Git Clone (Remote Repositories)

Simulate working with remote repositories using git clone:
git clone
This creates a simulated “origin” remote repository that you can push to and fetch from, just like a real Git workflow.

Additional Utility Commands

Show Commands

View all available commands with documentation links:
show commands
This displays:
  • All Git commands supported by Learn Git Branching
  • Links to official Git documentation for each command
  • Available options for each command
  • Custom learning commands specific to the tool

Export & Import Tree

Share your repository state with others:
# Export current repository state
export tree

# Import a previously exported state
import tree
This is useful for debugging or sharing interesting Git scenarios with others.

Flip

Change the direction of the commit tree visualization:
flip
This flips the tree vertically, which can make it easier to understand certain branching patterns.

Refresh

Manually refresh the visualization:
refresh

Echo

Output text to the terminal:
echo "Hello World"

Changing Locale

Change the language of the interface:
# Change to a specific locale (e.g., Spanish)
locale es_AR

# Reset to default locale
locale reset
Supported locales include en_US, es_AR, zh_CN, de_DE, ja, fr_FR, and many more.

Accessing Levels

While in sandbox mode, you can access the tutorial levels at any time:
# View all available levels
levels

# Start a specific level
level intro1

# Return to sandbox mode from a level
sandbox
See Levels for more information about the tutorial system.

Example Session

Here’s a typical sandbox mode session:
# Make some commits
git commit
git commit

# Create a branch
git branch feature

# Oops, made a mistake - undo it
undo

# Try again with the correct command
git checkout -b feature
git commit

# Experiment with rebasing
git rebase main

# Start over to try a different approach
reset

Tips for Using Sandbox Mode

Practice before levels: Use sandbox mode to practice commands before attempting level challenges.
Test solutions: Verify your solution works in sandbox mode before applying it to a level.
Share scenarios: Use export tree to share interesting Git scenarios with colleagues for discussion.
Demonstrate concepts: Sandbox mode is perfect for teaching Git concepts visually to others.

Next Steps

Build docs developers (and LLMs) love