core.hooksPath being set makes it not possible to install

See original GitHub issue

I have a laptop which has some mandaotry global settings for git, and I have not been able to enable pre-commit. I also tried doing

git config --global init.templateDir ~/.git-template
pre-commit init-templatedir ~/.git-template

But still get the message

[ERROR] Cowardly refusing to install hooks with `core.hooksPath` set.
hint: `git config --unset-all core.hooksPath`

Is there any work arounds for this?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
damienrjcommented, Jan 28, 2020

I did

pip uninstall pre-commit
pip install git+git://github.com/pre-commit/pre-commit.git@d56fdca618197c68937387292de0dcc19224068d
git config --global init.templateDir ~/.git-template
pre-commit init-templatedir ~/.git-template

And it looks like adding the uninstall step did make it work and now it reports pre-commit installed at /Users/damien/.git-template/hooks/pre-commit

0reactions
asottilecommented, Jan 28, 2020

cool

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cowardly refusing to install hooks with `core.hooksPath` set
Requiring to edit a personal file/setting to be able to use a software does not seems acceptable to be me. Anyway, the workaround...
Read more >
How to configure core.hooksPath for BitbucketServer 4.13
This is not an issue for our Bitbucket Server installation since there is only one user of git on the box, that being...
Read more >
[ERROR] Cowardly refusing to install hooks with `core ...
git config --unset-all core.hooksPath $ pre-commit install [ERROR] Cowardly refusing to install hooks with `core.hooksPath` set. hint: `git ...
Read more >
Support core.hooksPath - GitKraken User Suggestions
hooksPath config allows you to set a directory where the hooks are located for a repository. This is particularly useful if trying to...
Read more >
githooks Documentation - Git
Before Git invokes a hook, it changes its working directory to either $GIT_DIR in ... The second parameter is the branch being rebased,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found