Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

dvig14/gitbug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GitBug: Git Learning Simulator

GitHub stars GitHub license Python Contributors Welcome

โ— Note: This project is no longer actively maintained.
I originally built it as a Git simulation lab to deepen my understanding of Git internals.

It was part of my self-learning journey, and while it may not be perfect it helped me learn a lot through trial, error, and iteration.

๐Ÿ‘‰ I'm currently working on a new active project focused on DevOps failure simulations: FailOps Lab


GitBug is an CLI that teaches Git through hands-on bug fixing. Experience a realistic merge conflict scenario with visual feedback at every step - the first of many Git challenges to come! It helps you learn by doing, not just reading.

"Finally understand merge conflicts through practical experience!" - Early Tester


๐Ÿš€ Features

  • ๐Ÿ”€ Merge Conflict Scenario: A full guided simulation of a real-world Git merge conflict with step-by-step objectives
  • ๐Ÿ“Š Visual Git Internals: Track the working directory, staging area, and commit history visually
  • ๐Ÿž Bug Tracker: Simulate software bugs with role-based reporting, assigning, and tracking
  • ๐Ÿ’ก Command Insights: Use explain <command> to understand how Git works
  • ๐Ÿ‘ฅ Auto Team Setup (in Scenarios): Simulated teammates automatically push conflicting changes during scenario setups (not user-driven)
  • ๐ŸŒ Remote Repo Simulation: Used only in scenario-based bugs for merge/rebase cases; normal bugs run in simple local-only Git repos
  • ๐ŸŒŸ Error Diagnosis: Get helpful feedback and suggestions when you run into mistakes
  • ๐Ÿ” Graph Before/After View: Visualize Git state transitions before and after critical commands like merge, reset, and rebase
  • ๐Ÿ”น Command Hooks: Contribute new explanations or behaviors for Git commands

๐ŸŽฎ Demo of Merge Conflict with state visual and graph transitions

Scenario Start Git State Visualization Graph Transitions
scenario state graph

๐Ÿ“† Installation

git clone https://github.com/dvig14/gitbug.git cd gitbug

๐Ÿ’ก For best visuals, install rich (Recommended): pip install rich


๐Ÿงช Quickstart

python cli.py add # Report a new bug python cli.py assign # Assign a bug python cli.py list # View bugs python cli.py simulate # Start Git simulation

Follow the in-terminal prompts to solve the scenario.


๐Ÿชฉ Merge Conflict Walkthrough

graph TD A[Create Branch] --> B[Implement Fix] B --> C[Merge Changes] C --> D[Resolve Conflict] 
Loading

Youโ€™ll:

  • Create a feature branch
  • Fix a bug in login.css
  • Simulated a teammate conflict
  • Resolve and commit

๐Ÿ–ผ๏ธ Visual Git State (Implemented)

See Git's internal state evolve in real-time - unique to GitBug!

Initial State:

๐Ÿ“Š Git State Visualization โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ๐Ÿ“ Working Directory ๐Ÿ“ฅ Staging Area ๐Ÿ—ƒ Commit History โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ€ข login.css (modified) โ€ข (empty) โœ”๏ธ a1b2c: Initial commit โ€ข (no other changes) โœ”๏ธ d4e5f: Add header โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

After git add login.css:

๐Ÿ“Š Git State Visualization โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ๐Ÿ“ Working Directory ๐Ÿ“ฅ Staging Area ๐Ÿ—ƒ Commit History โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ€ข (no changes) โ€ข login.css โœ”๏ธ a1b2c: Initial commit โœ”๏ธ d4e5f: Add header โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

๐Ÿ—๏ธ Project Structure (Current Implementation)

cli.py # Main entry point CONTRIBUTING.md # How to contribute README.md # Overview gifs/ # scenario start, state, graph gitbugsim/ โ”œโ”€โ”€ bug_simulator/ # Bug tracker (add, assign, list) โ”œโ”€โ”€ data/ # JSON data: bugs, scenarios, users โ”œโ”€โ”€ explanations/ # Markdown help for commands โ”œโ”€โ”€ git_simulation/ # Git simulator + visualizer + hooks โ”œโ”€โ”€ scenarios/ # Scenario engine, remote engine & logic โ””โ”€โ”€ utils/ # Common helpers 

๐Ÿง  Roadmap

โœ… Phase 1 (Complete)

  • Merge Conflict Scenario
  • Bug Tracker System
  • Role-based CLI (reporter, developer, manager)
  • Visual Git State

๐Ÿงฒ Phase 2 (Planned)

  • Detached HEAD recovery
  • Reset vs Revert
  • Stashing changes
  • Rebase workflow (interactive, squash)

๐Ÿ”„ Phase 3 (Team Flow)

  • Pull request simulations
  • Teammate reviews
  • Remote push/pull scenarios

๐Ÿ‘ Contributing

Weโ€™re looking for:

  • Scenario creators (e.g., rebase, stash, reset, revert)
  • Contributors to explain <command> logic, add more git errors
  • Developers who can enhance visuals
  • Writers to document usage, command flow, and help messages

See CONTRIBUTING.md to get started!


๐Ÿ“œ License

GitBug is licensed under the MIT License - free to use, learn, and extend.


๐Ÿ™ Thanks

  • rich โ€” for beautiful CLI rendering
  • All contributors โ€” join the mission to make Git learning fun and real!

Join us in building the future of Git education!

Releases

No releases published

Packages

No packages published

Languages