gitmyhub

git-sim

Python ★ 4.7k updated 1mo ago

Visually simulate Git operations in your own repos with a single terminal command.

A command-line tool that shows what a Git command will do to your repository as a visual diagram or animated video before you run it, helping you safely preview operations like rebase, reset, or merge.

PythonManimsetup: moderatecomplexity 2/5

Git-sim is a command-line tool that produces visual diagrams showing what a Git command would do to your repository before you actually run it. Git is the version control system that developers use to track changes to code, and its commands can be difficult to reason about, especially operations like rebase or reset that rewrite history. Git-sim shows you the result as a picture or animated video, so you can see the effect without risk.

You run it from the terminal inside any existing Git repository. The syntax mirrors Git's own commands: instead of typing "git merge my-branch" you type "git-sim merge my-branch" and a diagram appears. By default it produces a static image in JPG or PNG format. With an optional flag it produces an animated MP4 or WebM video showing the operation step by step. Supported commands include add, branch, checkout, cherry-pick, commit, fetch, log, merge, pull, push, rebase, reset, restore, revert, stash, and others.

The tool is built on top of Manim, an animation library originally created for making math explanation videos. This means the setup has more steps than a typical pip install: you need to install Manim and its system-level dependencies first, which vary by operating system, before installing git-sim itself. Instructions in the README cover Windows, macOS, and Linux. Docker installation is also available if you want to avoid the dependency setup.

A companion tool called git-dummy is bundled alongside it. Git-dummy creates a fake Git repository with a specified number of branches and commits, which you can then use as a sandbox for trying out git-sim visualizations without touching a real codebase.

The project is open source and free. The README notes the maintainer is now working on a separate follow-on project called Devlands that extends these ideas further. Git-sim requires Python 3.7 or newer and is installed via pip.

Where it fits