Git & Version Control

Git simulatorSee history before a command

Choose an example and preview a history operation; no repository is connected.

Git simulator

Example commit graph

AA: Shared baseBB: Main updatemainCC: Feature changeDD: Feature testfeature

A–D and primed labels are teaching IDs, not Git object hashes.

History preview

Choose an example and preview an operation to see the result.

Only the fixed teaching graph is processed in this browser; no repository is read or contacted.

Options

Target branch: main · Source branch: feature

Ctrl/Cmd + Enter previews the chosen operation.

Choose an operation to preview.

This graph models fixed one-line files, not your real repository or Git merge strategy.

A Git simulator is useful when a branch graph makes the effect of merge, rebase or cherry-pick hard to picture. The sample starts with a shared commit, a main update and two feature commits.

Switch to the fast-forward or same-line example to see why a diagram alone cannot promise a conflict-free run. The command draft uses example branch names and needs review against your own repository.

Why use this Git simulator?

One start, three different histories

The Git simulator keeps the same commit graph while you compare merge, rebase and cherry-pick. A Git branching visualizer shows ancestry; this preview also names the branch pointer that moves and the commits that are copied.

Two branches diverge from one commit, then a merge node joins both parent lines without replacing earlier commits.

A visible limit on conflict claims

The fixed conflict example shows two edits to the same one-line app.js snapshot. A cherry-pick conflict or rebase stop is explained from that example only; your own files, index and merge options are unknown.

Two branches edit the same single-line file differently, with a warning marker before any new commit is shown.

Read the preview in three passes

01

Try the fast-forward example

When main is an ancestor of feature, merge moves the main pointer to the existing tip. The preview adds no merge commit, unlike the diverged sample.

02

Watch which commits are copied

Rebase replays C and D onto main as C′ and D′. Cherry-pick copies only the selected C or D onto main; the feature branch keeps its original tip.

03

Use the command draft as a checklist

Ctrl/Cmd + Enter previews the selected action. A changed option makes the old result stale, so copying waits for another preview. Replace the example commit placeholder before using any draft.

What changes in each graph

Merge keeps both lines

A diverged merge creates one node with two parents; the original commit graph remains. A fast-forward moves a pointer instead, so “merge commit” is not a universal result.

Rebase and cherry-pick copy commits

Rebase vs merge is visible as a different ancestry shape. Rebase copies the feature sequence; cherry-pick selects a single commit. Symbolic primed IDs are not real object hashes.

Conflict is tied to sample data

The same-line example compares three known file snapshots and marks where replay or merge stops. It cannot scan your repository or infer a real conflict probability.

What this model can and cannot establish

No repository access or execution
The graph is a fixed teaching sample. The page does not read Git log, clone a URL, change files or run a command; it cannot check dirty worktrees or remote policies.
No production safety verdict
A Git workflow simulator cannot decide whether rewriting a shared feature branch is safe for a team. The draft names main and feature only as examples; check your actual refs, working tree and collaborators.
Conflict scope is one-line snapshots
A same-line edit in the included app.js example is marked as a teaching conflict. Real Git may use text merge, rename detection or strategy options beyond this model; the page does not resolve files or run --continue.
No arbitrary command grammar
The three operation choices do not accept pasted Git commands, repository paths, push, pull, squash or interactive rebase. Those would require state and behavior absent from the sample graph.

Git simulator questions

When do you use Git rebase instead of Git merge?

Rebase can place your own unpublished feature commits on a new base for a linear view; merge keeps the branch ancestry and may create a two-parent commit. This Git simulator shows both shapes, but the right choice also depends on whether others share the branch.

Do I still need to merge after a successful rebase?

Rebase moves the feature tip in the example; main stays where it was. To integrate feature into main later, a merge or another integration step is still needed. After a clean rebase, that later merge may fast-forward.

Why does git rebase trigger a merge conflict?

Git replays each feature change onto the chosen base. If that change cannot apply cleanly to the updated content, replay stops for manual resolution. Here only the preset one-line app.js edits are checked, not your repository.

Why does cherry-pick always result in a merge conflict?

It does not always conflict. Selecting D in the clean example copies its independent test file; selecting C in the conflicting example encounters two different changes to app.js. Real results depend on the patch and target tree.

What is the difference between cherry-pick and rebase?

Cherry-pick selects one commit and copies its change onto main; rebase replays the feature sequence onto main and moves feature. The original source history remains in the teaching graph, but real Git object IDs differ after replay.

Does a preview differ from your device’s documented syntax?

Try the Git simulator now

Compare one graph across three operations, inspect a fixed conflict, then check every drafted command against your real branches before running it.