Learn Git commands hands-on by completing progressively harder challenges instead of reading documentation.
Practice advanced Git operations like rebasing, cherry-picking, or resolving conflicts in a safe sandbox.
Use the Docker image to run Githug without installing Ruby on your local machine.
Contribute new Git challenge levels to help other beginners learn specific operations.
Requires Ruby 2.7.1 specifically, does not work on Ruby 3.0 or higher, use the Docker image if you are on a newer Ruby version.
Githug is a command-line game for learning Git. It presents a series of levels, each one asking you to accomplish a specific Git task in a real terminal session. When you think you have solved the current level, you run the play command and Githug checks whether your Git commands produced the correct result. If you are stuck, a hint command is available for most levels. The game installs as a Ruby gem with a single command. Once installed, you run githug in the folder where you want to store game files, confirm the setup prompt, and the first level begins. The four commands you use while playing are play (check your solution), hint (get a tip), reset (restart the current level), and levels (list all available levels). Each level sets up a fresh Git repository state for you to work with. Levels range from basic tasks like staging a file and making a commit to more advanced operations. The game is designed to give hands-on practice rather than just reading documentation, so you use actual Git commands at each step. A note on compatibility: the FAQ warns that Githug does not currently work on Ruby 3.0 or higher. The recommended version is Ruby 2.7.1. The FAQ also notes a common issue where answers are not recognized correctly, and provides a fix involving setting the default branch name to master before resetting the level. The project is open source and contributions are welcome, including new levels. A Docker image is also available as an unofficial alternative to installing Ruby locally.
← gazler on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.