Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstalled pre-commit preventing 'git commit' (pipenv)

I recently uninstalled pre-commit from my environment. I performed the following in pipenv:

pipenv --rm
<deleted Pipfile and Pipfile.lock>
pipenv install -r requirements.txt 

I ensured that the pre-commit module was no longer in the requirements.txt. When I make a git commit I get:

~/my_project/.venv/bin/python: No module named pre_commit

This is preventing me from committing, and I have no idea where this is coming from, since pre-commit is not being installed. Further, the traceback path specified is pointing to python and not python3. What am I missing?

like image 520
pymat Avatar asked Jun 05 '26 07:06

pymat


1 Answers

typically the way to remove the hook installed by pre-commit install is to call pre-commit uninstall -- though if you've removed pre-commit from your system you can remove the hook scripts manually

you can usually find them by doing:

grep pre-commit.com .git/hooks/*

as that marker is listed in the hook files

from there you can delete them:

grep -l pre-commit.com .git/hooks/* | xargs rm

disclaimer: I made pre-commit

like image 196
Anthony Sottile Avatar answered Jun 07 '26 21:06

Anthony Sottile