1

I tried committing my Ruby on Rails code from Github desktop, and I got the below
error, please help me how to resolve this error and commit my code?

.git/hooks/commit-msg:167:in `validate': undefined method `keys' for nil:NilClass (NoMethodError)
    from .git/hooks/commit-msg:211:in `<main>'
torek
  • 448,244
  • 59
  • 642
  • 775
Angel
  • 19
  • 1
  • 1
    You have a hook (apparently written *in* Ruby) that tries to validate your commit message according to some set of local rules. Unfortunately, your commit hook has a bug in it. You'll need to show the code of that commit hook to someone who knows how to write programs in Ruby, so that they can debug it. In the meantime you *can* completely bypass the hook by adding `--no-verify` at the time you run the commit, or by moving the hook out of the way, but that's probably the wrong thing to do. – torek Jun 29 '22 at 06:12

1 Answers1

0

Since you need to not run that hook (pending resolution of the error message), know that GitHub Desktop itself does not directly support a git commit -n/--no-verify:

So you have to option a command-line:

  • press the commit button, and wait for it to show the error popup.
  • On the top window, select "Repository>Open in command prompt"
  • type git commit -n

Note (Oct. 2022), issue 11626 mentioned above references "Skip Git commit hooks" and declares:

I use this, works for me :)

git config --global core.hooksPath /dev/null
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250