Home > Back-end >  Why git keep giving me 'hello' when i ran git commit. And my staged file wasn't commi
Why git keep giving me 'hello' when i ran git commit. And my staged file wasn't commi

Time:12-07

Yesterday I created a git repository. My repository folder looks like:

repo contents

I ran git add -A, after that I ran git status. As you can see, my file is staged successfully. However when i ran commit -m 'first commit'. It kept giving me this message:

git commit message And my staged file hadn't been commited. Some ideas would be appreciated.

CodePudding user response:

I believe you have installed a pre-commit hook that:

  1. prints hello
  2. exits nonzero, so as to prevent the commit.

That would produce the behavior you see. To fix it, remove or fix the pre-commit hook. Look at .git/hooks/ and check your configuration for a core.hooksPath setting:

git config --get core.hooksPath

If the latter produces output, check that directory for a pre-commit hook.

  •  Tags:  
  • git
  • Related