Giter Club home page Giter Club logo

githug's Introduction

Githug

Git Your Game On

Build Status Code Climate

About

Githug 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.

Playing Githug

Githug should work on Linux, OS X and Windows.

Prerequisites

Githug requires Ruby 1.8.7 or higher.

You can check which version of Ruby is installed with the following command:

ruby --version

If ruby is not installed, follow the installation instructions on ruby-lang.org.

Installation

To install Githug, run

gem install githug

If you get a complaint about permissions, you can rerun the command with sudo:

sudo gem install githug

Usage with Docker

An unofficial Docker image for this project by @odiraneyya is available on (Docker Hub).

Starting the Game

After the gem is installed change directory to the location where you want the game-related assets to be stored. Then run githug:

githug

You will be prompted to create a directory.

No githug directory found, do you wish to create one? [yn]

Type y (yes) to continue, n (no) to cancel and quit Githug.

Commands

Githug has 4 game commands:

  • play - The default command, checks your solution for the current level
  • hint - Gives you a hint (if available) for the current level
  • reset - Reset the current level or reset the level to a given name or path
  • levels - List all the levels

Change Log

The change log is available on the wiki. Change log

Contributing

To suggest a level or create a level that has been suggested, check out the wiki.

Get yourself on the contributors list by doing the following:

  • Fork the repository
  • Make a level in the levels directory (covered below)
  • 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)
  • Make sure your level works (covered below)
  • Submit a pull request

Todo List

  • A follow-up to the level, more information on a specific command, etc.
  • More levels!

Writing Levels

Githug has a DSL for writing levels. Here is an example:

difficulty 1
description "There is a file in your folder called README, you should add it to your staging area"

setup do
  repo.init
  FileUtils.touch("README")
end

solution do
  return false unless repo.status.files.keys.include?("README")
  return false if repo.status.files["README"].untracked

  true
end

hint do
  puts "You can type `git` in your shell to get a list of available git commands"
end

difficulty, description and solution are required.

You can include multiple hints like this:

hints [
  "You can type `git` in your shell to get a list of available git commands",
  "Check the man for `git add`"]

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.)

You can call repo.init to initialize an empty repository.

All methods called on repo are sent to the grit gem if the method does not exist, and you can use that for most git related commands (repo.add, repo.commit, etc.).

Another method exists called init_from_level and it is used like so:

setup do
  init_from_level
end

This 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:

  • mkdir "yourlevel"
  • cd "yourlevel"
  • git init
  • some git stuff
  • important rename ".git" to ".githug" so that it isn't treated as a submodule
  • cd "../"
  • git add "yourlevel"

After 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.

Testing Levels

The easiest way to test a level is:

  • Change into your git_hug repository
  • Run githug reset PATH_TO_YOUR_LEVEL
  • Solve the level
  • Run githug test PATH_TO_YOUR_LEVEL

Please note that the githug test command can be run as githug test --errors to get an error stack trace from your solve method.

It 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.

FAQs

  1. Answers are not being checked properly

    This is a common issue we are facing and we are actively working to fix it. In the mean time, You can run this command, git branch -m master and continue with the levels. The issue arises because of the recent git update of calling the default branch main instead of master. Happy Learning!

githug's People

Contributors

annoyed avatar aq avatar cczona avatar courajs avatar detegr avatar dpick avatar dtrodrigues avatar duianto avatar ehershey avatar gazler avatar guywithnose avatar indiebrain avatar ipmsteven avatar joshleichtung avatar kchien avatar markus1189 avatar mmesaros avatar mocoso avatar mpxc8102 avatar odiraneyya avatar pallxk avatar pingtimeout avatar seejohnrun avatar sharnik avatar stdtom avatar tanner avatar thameera avatar thibaudcolas avatar tomstuart avatar zhanglintc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

githug's Issues

Test failed.

Githug is a very useful tool to learn git. I like to use it in git workshop.
But many developers are not good at english. So I would like to translate description and hints to Chinese .
I also found that there is a i18n branch, but it looks like out of date for a long time.

When I run rake on my Mac, it failed with:

undefined local variable or method `mock' for #<RSpec::ExampleGroups::GithugRepository::MethodMissing:0x007fa6c329e6b0>

I am not an expert in Ruby, could you tell me what is wrong?

Conflict level incompatible with Windows.

The conflict level was causing me trouble on Windows because it tries to use some bash commands, which won't work unless I'm running git bash or Cygwin.

Specifically:

txt = cat poem.txt

level 34: revert

In this level, I used git revert SHA1 to revert the bad commit. Here's the ordering for my repo.commits array:

0: "Revert "Bad commit""
1: "Bad commit"
2: "First commit"
3: "Second commit"

However, the solution expects:
0: "Revert "Bad commit""
1: "Bad commit"
2: "Second commit"
3: "First commit"

Please investigate :)

Internationalization

I'm wondering if it's possible to localize this project to another languages. If so, do you have any hint about how to do that?

I'm going to present a workshop here at Recife (northeastern coast of Brazil) and it would be great if I could use githug as assessment test.

Great tool, by the way :)

mac OS X 10.10.1 >> githug fails upon entering git_hug directory

The program runs if I am outside the git_hug directory but instructs me to cd into the git_hug directory. However, once I do, I get the following error (I have truncated it at the .rvm indicator for privacy)

/.rvm/gems/ruby-2.0.0-p598/gems/githug-0.4.3/lib/githug/profile.rb:17:in `merge': no implicit conversion of false into Hash (TypeError)

Level 28 (push): error: unknown switch `u'

Name: push
Level: 28
Difficulty: ***
Your local master branch has diverged from the remote origin/master branch. Rebase your commit onto origin/master and push it to remote.
...
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 2 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (2/2), done.
From /tmp/d20140423-12955-9f18mz/

  • [new branch] master -> origin/master
    error: unknown switch `u'
    usage: git branch [options] [-r | -a] [--merged | --no-merged]
    or: git branch [options] [-l] [-f] []
    or: git branch [options] [-r](-d | -D) ...
    or: git branch [options](-m | -M) []
    ...

$ git --version
git version 1.7.10.4

can not run githug test

after installed githug, I can run the other commands, but can not run the githug test

[zhch@AY140525170420149741Z git_hug]$ githug test init
********************************************************************************
*                                    Githug                                    *
********************************************************************************
/usr/lib/ruby/gems/1.8/gems/githug-0.4.2/lib/githug/game.rb:38:in `test_level': undefined method `full_description' for false:FalseClass (NoMethodError)
        from /usr/lib/ruby/gems/1.8/gems/githug-0.4.2/lib/githug/cli.rb:26:in `test'
        from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `send'
        from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
        from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
        from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
        from /usr/lib/ruby/gems/1.8/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
        from /usr/lib/ruby/gems/1.8/gems/githug-0.4.2/bin/githug:4
        from /usr/bin/githug:19:in `load'
        from /usr/bin/githug:19


[zhch@AY140525170420149741Z git_hug]$ githug play
********************************************************************************
*                                    Githug                                    *
********************************************************************************
Congratulations, you have solved the level!

Name: commit
Level: 4
Difficulty: *

The `README` file has been added to your staging area, now commit it.

nil

githug reset --errors throws runtime errors

When I run a normal level test, I got this errors.
For example, when testing cherry-pick level

githug test ~/git/githug/levels/cherry-pick.rb --errors
/Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby/internal/loose.rb:108:in `unpack_object_heade
_gently': undefined method `>>' for "x":String (NoMethodError)
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby/internal/loose.rb:56:in `get_raw
object'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby/internal/loose.rb:32:in `[]'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby/repository.rb:84:in `block in ge
_raw_object_by_sha1'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby/repository.rb:83:in `each'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby/repository.rb:83:in `get_raw_obj
ct_by_sha1'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby/repository.rb:334:in `walk_log'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby/repository.rb:287:in `log'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby/repository.rb:306:in `rev_list'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby.rb:68:in `block in rev_list'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby.rb:224:in `block in try_run'
        from /Users/yunlei/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
        from /Users/yunlei/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `block in catch'
        from /Users/yunlei/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `catch'
        from /Users/yunlei/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:35:in `catch'
        from /Users/yunlei/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:106:in `timeout'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby.rb:223:in `try_run'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/git-ruby.rb:68:in `rev_list'
from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/commit.rb:94:in `find_all'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/grit-2.3.0/lib/grit/repo.rb:327:in `commits'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/githug-0.2.12/lib/githug/repository.rb:41:in `method_missing'
        from (eval):10:in `block in setup'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/githug-0.2.12/lib/githug/level.rb:98:in `call'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/githug-0.2.12/lib/githug/level.rb:98:in `test'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/githug-0.2.12/lib/githug/game.rb:41:in `test_level'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/githug-0.2.12/lib/githug/cli.rb:26:in `test'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/gems/githug-0.2.12/bin/githug:4:in `<top (required)>'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/bin/githug:23:in `load'
        from /Users/yunlei/.rvm/gems/ruby-2.1.2/bin/githug:23:in `<main>'

Skipping a level

I've all ready done some of this.

specifically configuring name, email and ssh key.

is there a way to skip this step?

Stuck on Level 14

I am working through the levels and continually stopped by level 14

For reference; description:

The README file has been committed, but it looks like the file forgotten_file.rb was missing from the commit. Add the file and amend your previous commit to include it.

My attempt has been:

  1. git add forgotten_file.rb
  2. git commit --amend

My log shows only two commits before and afterwards. Is this wrong?

githug test

This is confusing me :

o_o:git_hug/ $ githug test [15:35:23]
"test" was called incorrectly. Call as "githug test".

AWESOME FUN!

Level 41 (conflict) does not work on windows

Resolved the conflicts just fine and removed the cool poem line as I saw you're supposed to do in the solution (the question text is also somewhat vague).

githug

My guess is that the
txt = cat poem.txt
line is not working but I'm not set up to test ruby.

not working just after gem install

tatooine:~ olgierd$ sudo gem install githug
Password:
Fetching: grit-2.4.1.gem (100%)
Fetching: githug-0.1.0.gem (100%)
Successfully installed diff-lcs-1.1.3
Successfully installed grit-2.4.1
Successfully installed githug-0.1.0
3 gems installed
Installing ri documentation for diff-lcs-1.1.3...
Installing ri documentation for grit-2.4.1...
Installing ri documentation for githug-0.1.0...
Installing RDoc documentation for diff-lcs-1.1.3...
Installing RDoc documentation for grit-2.4.1...
Installing RDoc documentation for githug-0.1.0...
tatooine:~ olgierd$ githug 
/Library/Ruby/Gems/1.8/gems/githug-0.1.0/lib/githug/ui.rb:4: uninitialized class variable @@out_stream in Githug::UI (NameError)
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
    from /Library/Ruby/Gems/1.8/gems/githug-0.1.0/lib/githug.rb:4
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
    from /Library/Ruby/Gems/1.8/gems/githug-0.1.0/lib/githug/cli.rb:2
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
    from /Library/Ruby/Gems/1.8/gems/githug-0.1.0/bin/githug:2
    from /usr/bin/githug:19:in `load'
    from /usr/bin/githug:19

Ruby 2.0 compatibility?

Hi -- used githug just fine with an older version of Ruby on another Linux x64 box. Today, however, I tried running githug on a Linux x64 system with Ruby 2.0 -- immediately ran into issues on Lvl 3 (git commit) and Lvl 5 (git clone https://...)

These levels are easy enough that a simple one-line command should suffice, but I keep on getting the error message that the solution is not quite right. Has anyone else reported similar issues?

Problems on windows

level 37 (push_branch)
It uses unix-specific command wc

The error message:

'wc' is not recognized as an internal or external command,
operable program or batch file.
Sorry, this solution is not quite right!

Level 15 on CentOS

I'm on CentOS 6.4 and installed git-all, ruby, and rubygems with yum.
On level 15, I provided the proper solution 'git push origin --tags', however when attempting to solve the level githug returns the following:

usage: git ls-remote [--heads] [--tags]  [-u <exec> | --upload-pack <exec>] <repository> <refs>...
Sorry, this solution is not quite right!

I noticed in levels/push_tags.rb the solution runs the following command:

repo.git.raw_git_call("git ls-remote --tags -q", repo.git.git_file_index).

I'm not sure why the command doesn't resolve correctly on CentOS, but I know it works fine on my Ubuntu box.

On my Ubuntu box on level 15, just running git ls-remote returns:

$ git ls-remote
From /tmp/d20131127-8696-jyaftd/.git/
acab266df4b736c799f0d9ca0c6021a9e6719e0b        HEAD
acab266df4b736c799f0d9ca0c6021a9e6719e0b        refs/heads/master

Obviously on the CentOS box git ls-remote fails, but I do see a directory under /tmp/d20131126-24127-sdkraf

Maybe on the CentOS box githug is having trouble finding or reading that directory?

If there is any other information I can provide to be helpful please let me know.

Level 17 Remote Error

On level 17, I get an error while trying to get the remote url:


~/git_hug(master) $ githug reset
********************************************************************************
*                                    Githug                                    *
********************************************************************************
resetting level

Level: 17
Difficulty: **

The remote repositories have a url associated to them.  Please enter the url of remote_location

~/git_hug(master) $ git remote
my_remote_repo
remote_location
~/git_hug(master) $ git remote show remote_location
fatal: https://github.com/githug/not_a_repo/info/refs not found: did you run git update-server-info on the server?

Of course, one can get the remote URL from this message, though I assume it was not intended.

Does level 4 accept utf characters?

It seems githug doesn't check utf-8 characters correctly.
Below is a screen cap from level 4, and I'm pretty sure those are the same names and e-mails ;-)

bash-3.2$ githug play
********************************************************************************
*                                    Githug                                    *
********************************************************************************
What is your name? Wiesław Herr
What is your email? [email protected]
Your config has the following name: Wiesław Herr
Your config has the following email: [email protected]
Sorry, this solution is not quite right!

Error 'gem install githug'

When I execute this command.
It says ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

Quick note on the Readme: You can return a value from a proc/block with 'break' or 'next'

Check it:

def test(&block)
  yield
end

test do
  break 'BREAKING EARLY'
  puts'NEVER GETS RUN'
end
# => 'BREAKING EARLY'

test do
  next 'NEXTING EARLY'
  puts 'NEVER GETS RUN'
end
# => 'NEXTING EARLY'

Of course, next is better served in an iterator context, as it gives control back to the method in order for it to call the block again. Example:

def test(&block)
  yield
  yield
  yield
  yield
  yield
end

test do
  puts 'RUNNING TEST 1'
  break 'BREAKING EARLY'
  puts'NEVER GETS RUN'
end
# => 'BREAKING EARLY'

test do
  puts 'RUNNING TEST 2'
  next 'NEXTING EARLY'
  puts 'NEVER GETS RUN'
end
# => RUNNING TEST 2
# => RUNNING TEST 2
# => RUNNING TEST 2
# => RUNNING TEST 2
# => RUNNING TEST 2
# => "NEXTING EARLY"

Level 7: requires .gitignore change, does not allow to use .git/info/excludes

Level 7 ("ignore") forces the user to change .gitignore file. However, it is possible to change just the repo's local excludes file, i.e. .git/info/excludes. I consider this solution better suited for ignoring editor-specific files (I don't believe .gitignore should include garbage files from all possible editors).

See the following:

$ cat .gitignore 
.profile.yml
.gitignore

$ cat .git/info/exclude 
*.swp

$ git add README.swp
The following paths are ignored by one of your .gitignore files:
README.swp
Use -f if you really want to add them.
fatal: no files added

$ githug play
********************************************************************************
*                                    Githug                                    *
********************************************************************************
Sorry, this solution is not quite right!

Name: ignore
Level: 7
Difficulty: **

The text editor 'vim' creates…

I believe a better implementation of this level would not check .gitignore contents, rather use git commands to check if the file is ignored or not (although I admit I don't know if git commands let us check it quickly).

Test "The Game should complete the push level" fails with push.default == simple

I got the tests running locally, but it seemed like about halfway through a test failed, and then all further tests failed. At the first failure I was getting this error text:

fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

Looking at the same spot on the travis build I saw this:

warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
  git config --global push.default matching
blah blah blah

You can reproduce this locally:

  1. git config --global push.default matching
  2. bundle exec rake (tests pass)
  3. git config --global push.default simple
  4. bundle exec rake (tests fail)

This might be fixable with local config for the push level, or by more explicitly setting the upstream for that level, or something to that effect. I'll play around with it a bit.

"nil" appears at the end of each level

When I run githug it will play the game as normal and display all the information, but also display nil at the end each time. For example:

MY_PROMPT$ githug
********************************************************************************
*                                    Githug                                    *
********************************************************************************
Congratulations, you have solved the level!

Name: clone
Level: 5
Difficulty: *

Clone the repository at https://github.com/Gazler/cloneme.

nil
MY_PROMPT$

Is that suppose to happen?

githug level 32

.git directory exists

o_o:git_hug/ $ githug reset

Level: 32
Difficulty: ***

A bug was introduced somewhere along the way. You know that running 'ruby prog.rb 5' should output 15. You can also run 'make test'. What are the first 7 chars of the hash of the commit that introduced the bug.

o_o:git_hug/ $ git status [15:35:02]
fatal: Not a git repository (or any of the parent directories): .git

o_o:git_hug/ $ ls -al [15:35:04]
total 40
drwxr-xr-x 8 o_o staff 272 Jul 10 15:35 .
drwxr-xr-x+ 107 o_o staff 3638 Jul 10 15:35 ..
drwxr-xr-x 12 o_o staff 408 Jul 10 15:35 .git

New Levels

What sort of levels do you think would be helpful?

git add --patch
git reflog

Level 15: Restructure

Level 15's instructions read:

You added some files to your repository, but now realize that your project needs to be restructured. Make a new folder named src, and move all of the .html files into this folder.

I created a folder & moved the files without using git mv. Git picked up the changes but without staging them the level would not pass. Obviously I ran githug hint to see what I missed but I think the instructions could be a bit more clear (in terms of the expectations) as I got it to pass without really learning about git mv.

who can help me?

Name: commit_in_future
Level: 20
i cant find the answer,just help me

How to play solved level?

I accidentally solved level 28, while I just trying and not understand what's going on.
Is there anything I can do to play it again?

Quotation marks used in level's descriptions/hints

I notice while doing #119 that the quotation mark used in level descriptions/hints changes is different. Some use ' and some use ```.

remote_url.rb hint:

You can run `git remote --help` for the man pages.

bisect.rb description:

A bug was introduced somewhere along the way.  You know that running 'ruby prog.rb 5' should output 15.  You can also run 'make test'.  What are the first 7 chars of the hash of the commit that introduced the bug.

blame.rb description:

Someone has put a password inside the file 'config.rb' find out who it was.

hint:

You want to research the `git blame` command.

I'd make a pull request, but I wanted to make sure that it was the "right way".

What is the correct quotation mark for...
files? e.g. add.rb description
tags? e.g. tag.rb
URLs?
commands?

Typo in README

I noticed that, in your README file, under the Testing Levels heading, you are missing closing backticks on two of the bullet points.

Final level does not work properly

The final level ("contribute.rb") attempts to fork the github repository using SSH, this appears to not work, when running "githug" while on level 42 I get this error message:

********************************************************************************
*                                    Githug                                    *
********************************************************************************
Cloning repository to /tmp/githug
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Sorry, this solution is not quite right!
Don't forget you can type `githug hint` for a hint and `githug reset` to reset the current level

Please delete this issue

Sorry guys, I'm new to creating a new issue/requesting a pull. I hope I did this right, if not can you please tell me how to do it right?

Level 14 fails on non-default pretty format for git log

If you have git log customizations then there's a good chance you will fail level 14. To get past it, after you add the forgotten file and commit it, you need to run the following commands before running githug to test if you passed the level:

$ echo "[format]" >> .git/config
$ echo " pretty = medium" >> .git/config

This will reset the git log format to the default for the repository. Note that every time you do githug reset or move on to a new level it'll overwrite the config files so you'll go back to your non-default format.

It might be a limitation of Grit but it caused an issue in githug nonetheless

Level 28 (Errno::ENAMETOOLONG)

Currently using c9.io Ubuntu environment
Full error log: https://goo.gl/7bRzm3

githug reset
resetting level
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/fileutils.rb:1365:in mkdir': File name too long @ dir_s_mkdir - /home/ubuntu/workspace/git_hug/d20150902-9102-ooqs0q/./d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q/d20150902-9102-ooqs0q (Errno::ENAMETOOLONG) from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/fileutils.rb:1365:incopy'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/fileutils.rb:471:in block in copy_entry' from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/fileutils.rb:1497:incall'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/fileutils.rb:1497:in wrap_traverse' from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/fileutils.rb:1500:inblock in wrap_traverse'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/fileutils.rb:1499:in each' from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/fileutils.rb:1499:inwrap_traverse'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/fileutils.rb:1500:in `block in wrap_traverse'

level 'revert' somewhat ambiguous

Sorry, I was under the impression a rebase might've solved this level. I no longer think that's true after a few experiments, but I also don't really know how to get back to a previous level to check.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.