Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git hooks pre-push is not working

Inside git hook folder, I have pre push file inside it i am running "npm run coverage" i.e. command for unit test coverage.

git-hook > pre-push > npm run coverage

but it is not working, can somebody please help me.

like image 542
RVCoder Avatar asked Sep 18 '17 05:09

RVCoder


2 Answers

  1. Check if its name is precisely pre-push (not pre-push.sh, not pre-push.py, precisely pre-push, with no file extension).
  2. Check if it's in .git/hooks/. If you have set core.hooksPath=xxx in the config, make sure it's under the directory xxx.
  3. Check if it's executable.
  4. Check if the user that runs pre-push also has the permission to run npm run coverage.
like image 133
ElpieKay Avatar answered Oct 12 '22 02:10

ElpieKay


check .git/hooks. If it's empty try to uninstall husky and install again. my sh history

 ls .git/hooks
 npm uninstall husky
 npm i husky -D
 ls .git/hooks

it helped me

like image 39
David Avatar answered Oct 12 '22 04:10

David