{"id":13368896,"url":"https://github.com/Gazler/githug","last_synced_at":"2025-03-12T20:31:09.221Z","repository":{"id":2726262,"uuid":"3721219","full_name":"Gazler/githug","owner":"Gazler","description":"Git your game on!","archived":false,"fork":false,"pushed_at":"2024-08-11T18:24:57.000Z","size":463,"stargazers_count":6849,"open_issues_count":46,"forks_count":1028,"subscribers_count":168,"default_branch":"master","last_synced_at":"2024-10-25T07:13:10.108Z","etag":null,"topics":["git"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gazler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-03-14T19:11:05.000Z","updated_at":"2024-10-24T17:11:46.000Z","dependencies_parsed_at":"2024-01-13T17:49:23.355Z","dependency_job_id":"e8d42939-0cb6-4ae2-b8ed-3281b0901520","html_url":"https://github.com/Gazler/githug","commit_stats":{"total_commits":303,"total_committers":108,"mean_commits":"2.8055555555555554","dds":0.570957095709571,"last_synced_commit":"c3bc5a19d9296b86c4a907a9e5960411dce7d0a7"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gazler%2Fgithug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gazler%2Fgithug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gazler%2Fgithug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gazler%2Fgithug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gazler","download_url":"https://codeload.github.com/Gazler/githug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242967506,"owners_count":20214280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git"],"created_at":"2024-07-30T01:01:11.041Z","updated_at":"2025-03-12T20:31:09.185Z","avatar_url":"https://github.com/Gazler.png","language":"Shell","readme":"# Githug\nGit Your Game On \n\n[![Build Status](https://travis-ci.org/Gazler/githug.svg?branch=master)](https://travis-ci.org/Gazler/githug) [![Code Climate](https://codeclimate.com/github/Gazler/githug.svg)](https://codeclimate.com/github/Gazler/githug)\n\n## About\nGithug is designed to give you a practical way of learning git.  It has a series of levels, each requiring you to use git commands to arrive at a correct answer.\n\n## Playing Githug\n\nGithug should work on Linux, OS X and Windows.\n\n### Prerequisites\n\nGithug requires Ruby 1.8.7 or higher.\n\nYou can check which version of Ruby is installed with the following command:\n\n```\nruby --version\n```\n\nIf ruby is not installed, follow the installation instructions on [ruby-lang.org](https://www.ruby-lang.org/en/documentation/installation/).\n\n### Installation\n\nTo install Githug, run\n\n    gem install githug\n\nIf you get a complaint about permissions, you can rerun the command with `sudo`:\n\n    sudo gem install githug\n    \n#### Usage with Docker\n\nAn unofficial _Docker_ image for this project by [@odiraneyya](https://github.com/odiraneyya) is available on ([Docker Hub](https://hub.docker.com/r/orwa84/githug)).\n\n### Starting the Game\n\nAfter the gem is installed change directory to the location where you want the game-related assets to be stored.\nThen run `githug`:\n\n    githug\n\nYou will be prompted to create a directory.\n\n    No githug directory found, do you wish to create one? [yn]\n\nType `y` (yes) to continue, `n` (no) to cancel and quit Githug.\n\n### Commands\n\nGithug has 4 game commands:\n\n * play - The default command, checks your solution for the current level\n * hint - Gives you a hint (if available) for the current level\n * reset - Reset the current level or reset the level to a given name or path\n * levels - List all the levels\n\n## Change Log\n\nThe change log is available on the wiki.  [Change log](https://github.com/Gazler/githug/wiki/Change-Log)\n\n## Contributing\n\nTo suggest a level or create a level that has been suggested, check out [the wiki](https://github.com/Gazler/githug/wiki).\n\n Get yourself on the [contributors list](https://github.com/Gazler/githug/contributors) by doing the following:\n\n * Fork the repository\n * Make a level in the levels directory (covered below)\n * Add your level to the LEVELS array inside `lib/githug/level.rb` in a position that makes sense (the \"commit\" level after the \"add\" and \"init\" levels for example)\n * Make sure your level works (covered below)\n * Submit a pull request\n\n## Todo List\n\n * A follow-up to the level, more information on a specific command, etc.\n * More levels!\n\n## Writing Levels\n\nGithug has a DSL for writing levels. Here is an example:\n\n```ruby\ndifficulty 1\ndescription \"There is a file in your folder called README, you should add it to your staging area\"\n\nsetup do\n  repo.init\n  FileUtils.touch(\"README\")\nend\n\nsolution do\n  return false unless repo.status.files.keys.include?(\"README\")\n  return false if repo.status.files[\"README\"].untracked\n\n  true\nend\n\nhint do\n  puts \"You can type `git` in your shell to get a list of available git commands\"\nend\n```\n\n `difficulty`, `description` and `solution` are required.\n\nYou can include multiple hints like this:\n\n```ruby\nhints [\n  \"You can type `git` in your shell to get a list of available git commands\",\n  \"Check the man for `git add`\"]\n```\n\n By default, `setup` will remove all files from the game folder.  You do not need to include a setup method if you don't want an initial git repository (if you are testing `git init` or only checking an answer.)\n\n You can call `repo.init` to initialize an empty repository.\n\n All methods called on `repo` are sent to the [grit gem](https://github.com/mojombo/grit) if the method does not exist, and you can use that for most git related commands (`repo.add`, `repo.commit`, etc.).\n\nAnother method exists called `init_from_level` and it is used like so:\n\n```ruby\nsetup do\n  init_from_level\nend\n```\n\nThis will copy the contents of a repository specified in the levels folder for your level.  For example, if your level is called \"merge\" then it will copy the contents of the \"merge\" folder.  It is recommended that you perform the following steps:\n\n * mkdir \"yourlevel\"\n * cd \"yourlevel\"\n * git init\n * some git stuff\n * **important** rename \".git\" to \".githug\" so that it isn't treated as a submodule\n * cd \"../\"\n * git add \"yourlevel\"\n\nAfter doing this, your level should be able to copy the contents from that git repository and use those for your level.  See the \"blame\" level for an example of this.\n\n## Testing Levels\n\nThe easiest way to test a level is:\n\n * Change into your git_hug repository\n * Run `githug reset PATH_TO_YOUR_LEVEL`\n * Solve the level\n * Run `githug test PATH_TO_YOUR_LEVEL`\n\nPlease note that the `githug test` command can be run as `githug test --errors` to get an error stack trace from your solve method.\n\nIt would be ideal if you add an integration test for your level.  These tests live in `spec/githug_spec` and **must** be run in order.  If you add a level but do not add a test, please add a simple `skip_level` test case similar to the `contribute` level.\n\n## FAQs\n\n1. Answers are not being checked properly\n\n   *This is a common issue we are facing and we are actively working to fix it.*\n\n   For now, run the following commands to change the default branch name to master. This should fix most of the issues you may face.\n   ```\n   $ git config --global init.defaultBranch master\n   $ githug reset\n   ```\n\n   From the current level forward, the default branch will be `master`.\n\n2. `githug` command doesn't work\n\n    Githug currently isn't supported on ruby versions ^3.0.0. Use any ruby version below 3.0.0 (preferrably 2.7.1).\n\n    If you use rvm, execute the below commands\n\n    ```\n    $ rvm install 2.7.1\n    $ rvm use 2.7.1\n    ```\n\n    If you use rbenv, execute the below commands\n\n    ```\n    $ rbenv install 2.7.1\n    $ rbenv global 2.7.1\n    ```\n\n","funding_links":[],"categories":["Shell","Uncategorized","git"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGazler%2Fgithug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGazler%2Fgithug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGazler%2Fgithug/lists"}