How to use Git Visualizer
Git records snapshots connected by parent links. A branch is a movable name for one commit, and HEAD tells Git which branch or commit you are currently using.
- In Command Builder, search for an intent, fill each parameter, and choose options. Read the explanation and warning beside the generated command. Select POSIX or PowerShell syntax before copying. Every user argument is quoted for that shell.
- In the visualizer, create a branch, switch to it, and commit. Switch back to main and commit again to create a divergence. Merge connects histories; rebase replays a linear set of changes on a new base with new commit IDs.
- Use Previous and Next to inspect earlier simulation states. Applying an operation from an earlier step replaces the later simulation steps. Save named scenarios in this browser or export a portable JSON file.
A practical starting point
Before changing history, inspect your working tree and the commits you are about to affect. A force-with-lease push is safer than an unconditional force, but still rewrites a remote branch.
git status git log --oneline --graph --all --decorate git diff # Read the output before making changes.
Common mistakes
- A safe-looking shell command can still have destructive Git semantics. Review the branch, remote, flags and warning before running it in your own terminal.
- Rebase and amend create new commit IDs. Avoid rewriting commits others already depend on without coordinating.
- This visualizer is a teaching model: commits add a unique sample file, merge conflicts stop for explanation, and rebase handles linear histories. It is not a full Git implementation and never accesses a real repository. Soft reset moves the branch; mixed also resets the index; hard also resets the tracked working-tree snapshot.
Frequently asked questions
Does Codipry run these commands?
No. The builder generates text, and the visualizer changes a local data model. You decide whether and where to run any generated command.
Why do merge and rebase look different?
A merge commit preserves both parent links. Rebase replays changes onto a new parent, replacing the copied commits with new IDs.
Can reset recover deleted untracked files?
No. Git cannot recover files it never recorded. In particular, git clean with force can permanently delete untracked files and directories.