An interactive web application for visualizing Git branches and commit relationships with animation controls and GitHub integration.
- Built with React Flow for smooth, drag-and-drop interactions
- Custom branch and commit nodes with detailed information
- Zoom, pan, and minimap for easy navigation
- Real-time graph manipulation
- Visual representation of Git branches as nodes
- Commit relationships shown with animated edges
- Color-coded branches for easy identification
- Hover tooltips with commit details
- Play/pause animation of commit history
- Step-through mode for detailed exploration
- Adjustable playback speed (0.5x to 5x)
- Timeline scrubbing
- Load real repositories from GitHub
- Fetch branch and commit data via GitHub API
- Support for public repositories
- Optional GitHub token for higher rate limits
- Pre-configured example workflows:
- Simple Feature Branch
- Gitflow Workflow
- Release Workflow with Hotfix
- Learn common Git branching strategies
- Real-time branch search
- Multi-select branch filtering
- Focus on specific development lines
- Node.js 18+
- npm or yarn
- Clone the repository:
git clone https://github.com/filiksyos/git-branch-visualizer.git
cd git-branch-visualizer- Install dependencies:
npm install- (Optional) Set up GitHub token:
cp .env.example .env
# Edit .env and add your GitHub token- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
- Click "Load Repository" in the header
- Enter a GitHub repository URL in one of these formats:
owner/repo(e.g.,facebook/react)https://github.com/owner/repo
- Click "Load" to fetch and visualize
- Click "Load Preset Graph" in the sidebar
- Choose from example workflows
- Use animation controls to step through the history
- Play/Pause: Start or stop the animation
- Step Back/Forward: Navigate commit by commit
- Reset: Return to the beginning
- Speed: Adjust playback speed
- Use the search box in the sidebar
- Click branch names to toggle selection
- Graph updates to show only selected branches
- Framework: Next.js 15
- Language: TypeScript 5.6
- Graph Library: React Flow 12.3
- State Management: Zustand 5.0
- Styling: Tailwind CSS 3.4
- UI Components: Radix UI
- Animations: Framer Motion
- Icons: Lucide React
git-branch-visualizer/
├── app/ # Next.js app directory
│ ├── api/github/ # GitHub API integration
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Main page
│ └── globals.css # Global styles
├── components/
│ ├── graph/ # Graph canvas & nodes
│ ├── layout/ # Layout components
│ └── dialogs/ # Modal dialogs
├── lib/
│ ├── store/ # Zustand stores
│ ├── github/ # GitHub client
│ └── graph/ # Graph utilities
├── hooks/ # Custom React hooks
└── types/ # TypeScript types
GitHub API has rate limits:
- Without token: 60 requests/hour
- With token: 5,000 requests/hour
For better experience, add a GitHub personal access token to .env:
NEXT_PUBLIC_GITHUB_TOKEN=your_token_hereCreate a token at: https://github.com/settings/tokens
Space- Play/Pause animation←- Previous step→- Next stepR- Reset animation
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - feel free to use this project for learning or commercial purposes.
Based on graph-viz by Jakub Krasuski
Built with ❤️ using Next.js and React Flow