An advanced, interactive Git internals visualizer built with React and TypeScript
Live Demo β’ Report Bug β’ Request Feature
gitTOW is a sophisticated, browser-based Git simulator that provides real-time visualization of Git's internal data structures. It's an educational tool designed to help developers understand how Git works under the hood by simulating a complete Git environment with an animated Directed Acyclic Graph (DAG) representation.
- Interactive Terminal - Full-featured Git command simulation with 20+ commands
- Real-time DAG Visualization - Animated commit graph with branches, tags, and merge nodes
- Pan & Zoom Controls - Navigate large commit histories with mouse drag and scroll
- Cyberpunk Aesthetic - Eye-catching dark mode UI with neon colors and glow effects
- State Inspector - View staging area, working directory, and stash in real-time
- Instant Feedback - See how Git commands affect the repository structure immediately
- Educational - Perfect for learning Git internals and visualizing complex workflows
- Node.js (v16 or higher)
- npm or yarn
-
Clone the repository
git clone https://github.com/Shreyas8905/gitTOW.git cd gitTOW -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:5173/
npm run buildThe production build will be created in the dist/ directory.
-
Initialize a repository
git init
-
Create and modify files
touch README.md echo "Hello World" > app.js
-
Stage and commit changes
git add . git commit -m "Initial commit"
-
Work with branches
git branch feature git checkout feature touch feature.js git add . git commit -m "Add feature"
-
Merge branches
git checkout master git merge feature
git init- Initialize a new repositorygit status- Show working tree statusgit log [--oneline]- Display commit history
git add <files>- Stage files (use.for all)git commit -m "message"- Create a commit
git branch [name]- List or create branchesgit branch -m <new-name>- Rename current branchgit branch -d <name>- Delete a branchgit checkout <ref>- Switch to branch/commitgit switch <branch>- Modern checkout alternativegit tag <name> [hash]- Create a tag
git merge <branch>- Merge with three-way mergegit rebase <branch>- Replay commits on new basegit cherry-pick <hash>- Apply specific commit
git reset [--soft|--mixed|--hard] <target>- Move HEADgit revert <hash>- Create inverse commitgit restore <file> [--staged]- Restore files
git stash [push|pop|list]- Save/restore work-in-progressgit clean -fd- Remove untracked files
touch <filename>- Create empty fileecho "text" > <filename>- Write content to filehelp- Show available commandsclear- Clear terminal output
| Technology | Purpose |
|---|---|
| React 19 | UI framework with functional components and hooks |
| TypeScript | Type-safe development |
| Vite 7 | Lightning-fast build tool and dev server |
| Zustand | Lightweight state management |
| Framer Motion | Smooth animations and transitions |
| Tailwind CSS v3 | Utility-first styling with custom cyberpunk theme |
| d3-hierarchy | Graph layout calculations |
gitTOW/
βββ src/
β βββ components/
β β βββ Graph/
β β β βββ GitGraph.tsx # Main SVG graph visualization
β β β βββ GraphNode.tsx # Individual commit rendering
β β βββ StateInspector/
β β β βββ StateInspector.tsx # File state panel
β β βββ Terminal/
β β βββ Terminal.tsx # Command interface
β βββ engine/
β β βββ gitEngine.ts # Core Git operations
β β βββ commands.ts # Command parser & dispatcher
β βββ store/
β β βββ gitStore.ts # Zustand state management
β βββ types/
β β βββ git.types.ts # TypeScript interfaces
β βββ App.tsx # Main application
β βββ index.css # Global styles + Tailwind
β βββ main.tsx # React entry point
βββ public/ # Static assets
βββ dist/ # Production build output
βββ package.json
- GitEngine - Simulates Git's internal data structures (commits, refs, HEAD, index)
- Command Parser - Routes commands to appropriate handlers with validation
- GitGraph - SVG-based visualization with layered layout algorithm
- Terminal - Interactive command input with history navigation
- StateInspector - Real-time view of staging area, working directory, and stash
gitTOW features a Cyberpunk/Hacker aesthetic with:
- Dark Mode Only - Deep charcoal backgrounds (#0F111A)
- Neon Color Palette:
- Primary (Neon Green): #00FF9F
- Secondary (Cyan): #00D9FF
- Accent (Pink): #FF006E
- Glow Effects - Text and UI elements with cyberpunk glow
- Monospace Fonts - Fira Code, Cascadia Code for that terminal feel
- Smooth Animations - Powered by Framer Motion
gitTOW is ideal for:
- Learning Git Internals - Visualize how commits, branches, and HEAD interact
- Understanding Complex Workflows - See merge vs rebase side-by-side
- Teaching Git Concepts - Perfect for workshops and tutorials
- Debugging Mental Models - Clarify confusing concepts like detached HEAD
- Practicing Git Commands - Safe environment to experiment
Interactive Git graph with commit nodes, branches, and tags
Command execution with real-time state updates
Navigate large commit histories effortlessly
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLintContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- No conflict resolution simulation (merges auto-succeed)
- Simplified file content tracking (no diffs)
- Single user mode (all commits by "User")
- No remote repository simulation (no push/pull/fetch)
- Limited undo for
reset --hard(mimics real Git)
- Remote repository simulation (origin/master)
- Conflict resolution UI
- Interactive graph manipulation (drag nodes, right-click menus)
- Export graph as PNG/SVG
- Time-travel replay of command history
- Multi-user simulation with different authors
- Git hooks visualization
- Mobile responsive design
This project is licensed under the MIT License - see the LICENSE file for details.
Shreyas
- GitHub: @Shreyas8905
- Project Link: https://github.com/Shreyas8905/gitTOW
- Inspired by Git's internal architecture
- Built with modern web technologies
- Designed for education and learning
- Community feedback and contributions
If you found this project helpful, please consider giving it a star on GitHub!
Made with passion by Shreyas Kulkarni